aboutsummaryrefslogtreecommitdiff
path: root/en/source/initializing.html
diff options
context:
space:
mode:
Diffstat (limited to 'en/source/initializing.html')
-rw-r--r--en/source/initializing.html135
1 files changed, 62 insertions, 73 deletions
diff --git a/en/source/initializing.html b/en/source/initializing.html
index b4f7b594..7e87f5e1 100644
--- a/en/source/initializing.html
+++ b/en/source/initializing.html
@@ -61,9 +61,9 @@ versions.</p>
<h4 id="for-ubuntu-15-04">For Ubuntu &gt;= 15.04</h4>
<p>Run the following:</p>
-<pre>
-$ sudo apt-get update
-$ sudo apt-get install openjdk-8-jdk
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">sudo apt-get update</code>
+<code class="devsite-terminal">sudo apt-get install openjdk-8-jdk</code>
</pre>
<h4 id="for-ubuntu-14-04">For Ubuntu LTS 14.04</h4>
@@ -91,23 +91,23 @@ with SHA256 <code>6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c
<p>Optionally, confirm the checksums of the downloaded files against the SHA256
string listed with each package above.</p>
<p>For example, with the <code>sha256sum</code> tool:</p>
-<pre>
-$ sha256sum {downloaded.deb file}
+<pre class="devsite-terminal devsite-click-to-copy">
+sha256sum {downloaded.deb file}
</pre>
</li>
<li>
<p>Install the packages:</p>
-<pre>
-$ sudo apt-get update
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo apt-get update
</pre>
<p>Run <code>dpkg</code> for each of the .deb files you downloaded. It may produce errors due to
missing dependencies:</p>
-<pre>
-$ sudo dpkg -i {downloaded.deb file}
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo dpkg -i {downloaded.deb file}
</pre>
<p>To fix missing dependencies:</p>
-<pre>
-$ sudo apt-get -f install
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo apt-get -f install
</pre>
</li>
</ol>
@@ -116,9 +116,9 @@ $ sudo apt-get -f install
<p>Optionally, for the Ubuntu versions above update the default Java version by
running:</p>
-<pre>
-$ sudo update-alternatives --config java
-$ sudo update-alternatives --config javac
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">sudo update-alternatives --config java</code>
+<code class="devsite-terminal">sudo update-alternatives --config javac</code>
</pre>
<p>If, during a build, you encounter version errors for Java, set its
@@ -129,11 +129,8 @@ Java Version</a> section.</p>
<p>You will need a 64-bit version of Ubuntu. Ubuntu 14.04 is recommended.</p>
-<pre>
-$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
- zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
- lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
- libgl1-mesa-dev libxml2-utils xsltproc unzip
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
</pre>
<p class="note"><strong>Note:</strong> To use SELinux tools for policy
@@ -149,13 +146,9 @@ package.</p>
<p>You may use Ubuntu 12.04 to build older versions of Android. Version 12.04
is not supported on master or recent releases.</p>
-<pre>
-$ sudo apt-get install git gnupg flex bison gperf build-essential \
- zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
- libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
- libgl1-mesa-dev g++-multilib mingw32 tofrodos \
- python-markdown libxml2-utils xsltproc zlib1g-dev:i386
-$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386</code>
+<code class="devsite-terminal">sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so</code>
</pre>
<h3 id="installing-required-packages-ubuntu-1004-1110">Installing required
@@ -163,24 +156,20 @@ packages (Ubuntu 10.04 -- 11.10)</h3>
<p>Building on Ubuntu 10.04-11.10 is no longer supported, but may be useful for
building older releases of AOSP.</p>
-<pre>
-$ sudo apt-get install git gnupg flex bison gperf build-essential \
- zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
- x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
- libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
- libxml2-utils xsltproc
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo apt-get install git gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc
</pre>
<p>On Ubuntu 10.10:</p>
-<pre>
-$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
+<preclass="devsite-terminal devsite-click-to-copy">
+sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
</pre>
<p>On Ubuntu 11.10:</p>
-<pre>
-$ sudo apt-get install libx11-dev:i386
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo apt-get install libx11-dev:i386
</pre>
<h3 id="configuring-usb-access">Configuring USB Access</h3>
@@ -195,8 +184,8 @@ system needs to be configured to allow such access.</p>
href="51-android.txt">51-android.txt</a> file attached to this site, modify
it to include your username, and place it in the correct location:</p>
-<pre>
-$ wget -S -O - http://source.android.com/source/51-android.txt | sed "s/&lt;username&gt;/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
+<pre class="devsite-terminal devsite-click-to-copy">
+wget -S -O - http://source.android.com/source/51-android.txt | sed "s/&lt;username&gt;/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
</pre>
<p>Those new rules take effect the next time a device is plugged in.
@@ -219,8 +208,8 @@ in case of filesystem corruption.</p>
to point to the location where your output directories
will be stored.</p>
-<pre>
-$ export OUT_DIR_COMMON_BASE=&lt;path-to-your-out-directory&gt;
+<pre class="devsite-terminal devsite-click-to-copy">
+export OUT_DIR_COMMON_BASE=&lt;path-to-your-out-directory&gt;
</pre>
<p>The output directory for each separate source tree will be
@@ -263,8 +252,8 @@ saves space while allowing to grow later as the need arises. Be sure to select
"case sensitive, journaled" as the volume format.</p>
<p>You can also create it from a shell with the following command:</p>
-<pre>
-# hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg
+<pre class="devsite-click-to-copy">
+<span class="no-select"># </span>hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg
</pre>
<p>This will create a <code>.dmg</code> (or possibly a
@@ -274,8 +263,8 @@ the required formatting for Android development.</p>
<p>If you need a larger volume later, you can also resize the sparse image with
the following command:</p>
-<pre>
-# hdiutil resize -size &lt;new-size-you-want&gt;g ~/android.dmg.sparseimage
+<pre class="devsite-click-to-copy">
+<span class="no-select"># </span>hdiutil resize -size &lt;new-size-you-want&gt;g ~/android.dmg.sparseimage
</pre>
<p>For a disk image named <code>android.dmg</code> stored in your home
@@ -285,7 +274,7 @@ directory, you can add helper functions to your <code>~/.bash_profile</code>:</p
<li>
To mount the image when you execute <code>mountAndroid</code>:</p>
-<pre>
+<pre class="devsite-click-to-copy">
# mount the android file image
function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }
</pre>
@@ -297,7 +286,7 @@ function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/androi
<li>
<p>To unmount it when you execute <code>umountAndroid</code>:</p>
-<pre>
+<pre class="devsite-click-to-copy">
# unmount the android file image
function umountAndroid() { hdiutil detach /Volumes/android; }
</pre>
@@ -318,8 +307,8 @@ use when developing various versions of Android.</p>
<ol>
<li>
<p>Install Xcode command line tools with:
-<pre>
-$ xcode-select --install
+<pre class="devsite-terminal devsite-click-to-copy">
+xcode-select --install
</pre>
<p>For older versions of Mac OS (10.8 or earlier), you need to install Xcode from
@@ -337,8 +326,8 @@ href="http://www.macports.org/install.php">macports.org</a>.</p>
<code>/usr/bin</code>. If not, please add the following to your
<code>~/.bash_profile</code> file:</p>
-<pre>
-<code>export PATH=/opt/local/bin:$PATH</code>
+<pre class="devsite-click-to-copy">
+export PATH=/opt/local/bin:$PATH
</pre>
<p class="note"><strong>Note:</strong> If you do not have a
@@ -348,13 +337,13 @@ href="http://www.macports.org/install.php">macports.org</a>.</p>
<li>
<p>Get make, git, and GPG packages from MacPorts:</p>
-<pre>
-$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git gnupg
+<pre class="devsite-terminal devsite-click-to-copy">
+POSIXLY_CORRECT=1 sudo port install gmake libsdl git gnupg
</pre>
<p>If using Mac OS X v10.4, also install bison:</p>
-<pre>
-$ POSIXLY_CORRECT=1 sudo port install bison
+<pre class="devsite-terminal devsite-click-to-copy">
+POSIXLY_CORRECT=1 sudo port install bison
</pre>
</li>
</ol>
@@ -368,35 +357,35 @@ MacPorts with these steps:</p>
<ol>
<li>
<p>Edit <code>/opt/local/etc/macports/sources.conf</code> and add a line that says:</p>
-<pre>
+<pre class="devsite-click-to-copy">
file:///Users/Shared/dports
</pre>
<p>above the rsync line. Then create this directory:</p>
-<pre>
-$ mkdir /Users/Shared/dports
+<pre class="devsite-terminal devsite-click-to-copy">
+mkdir /Users/Shared/dports
</pre>
</li>
<li>
<p>In the new <code>dports</code> directory, run:</p>
-<pre>
-$ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
+<pre class="devsite-terminal devsite-click-to-copy">
+svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
</pre>
</li>
<li>
<p>Create a port index for your new local repository:</p>
-<pre>
-$ portindex /Users/Shared/dports
+<pre class="devsite-terminal devsite-click-to-copy">
+portindex /Users/Shared/dports
</pre>
</li>
<li>
<p>Install the old version of gmake with:</p>
-<pre>
-$ sudo port install gmake @3.81
+<pre class="devsite-terminal devsite-click-to-copy">
+sudo port install gmake @3.81
</pre>
</li>
</ol>
@@ -407,7 +396,7 @@ $ sudo port install gmake @3.81
open is too low and a highly parallel build process may exceed this limit.</p>
<p>To increase the cap, add the following lines to your <code>~/.bash_profile</code>: </p>
-<pre>
+<pre class="devsite-click-to-copy">
# set the number of open files to be 1024
ulimit -S -n 1024
</pre>
@@ -429,17 +418,17 @@ slow your builds down by making you pay for cache misses.</p>
<p>To use ccache, issue these commands in the root of the source tree:</p>
-<pre>
-$ export USE_CCACHE=1
-$ export CCACHE_DIR=/&lt;path_of_your_choice&gt;/.ccache
-$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">export USE_CCACHE=1</code>
+<code class="devsite-terminal">export CCACHE_DIR=/&lt;path_of_your_choice&gt;/.ccache</code>
+<code class="devsite-terminal">prebuilts/misc/linux-x86/ccache/ccache -M 50G</code>
</pre>
<p>The suggested cache size is 50-100G.</p>
<p>Put the following in your <code>.bashrc</code> (or equivalent):</p>
-<pre>
+<pre class="devsite-click-to-copy">
export USE_CCACHE=1
</pre>
@@ -449,14 +438,14 @@ you will want to specify the directory in your <code>.bashrc</code> file too.</p
<p>On Mac OS, you should replace <code>linux-x86</code> with <code>darwin-x86</code>:</p>
-<pre>
+<pre class="devsite-click-to-copy">
prebuilts/misc/darwin-x86/ccache/ccache -M 50G
</pre>
<p>When building Ice Cream Sandwich (4.0.x) or older, ccache is in
a different location:</p>
-<pre>
+<pre class="devsite-click-to-copy">
prebuilt/linux-x86/ccache/ccache -M 50G
</pre>
@@ -464,8 +453,8 @@ prebuilt/linux-x86/ccache/ccache -M 50G
<p>On Linux, you can watch ccache being used by doing the following:</p>
-<pre>
-$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
+<pre class="devsite-terminal devsite-click-to-copy">
+watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
</pre>
<h2 id="next-download-the-source">Next: Download the source</h2>