Download and compile the android source code in Ubuntu 9.10

Source: Internet
Author: User

Write down the steps for compiling the source code under ubuntu9.10 for future reference:

Sudo apt-Get install Git-core curl

Sudo apt-Get install GCC g ++ flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind

1. ubuntu9.04 is libsdl-Dev

Ubuntu9.04 is libsdl-Dev

With the jdk5 source, ubuntu9.10 does not have the jdk5 source by default.

  1. 1. Deb [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty main restricted universe multiverse
  2. 2. Deb-Src [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty main restricted universe multiverse
  3. 3. Deb [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty-Updates main restricted universe multiverse
  4. 4. Deb-Src [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty-Updates main restricted universe multiverse
  5. 5. Deb [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty-backports main restricted universe multiverse
  6. 6. Deb-Src [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty-backports main restricted universe multiverse
  7. 7. Deb [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty-security main restricted universe multiverse
  8. 8. Deb-Src [url] http://run.hit.edu.cn/ubuntu/#/url] jaunty-security main restricted universe multiverse
  9. 9.
  10. 10. After update, use sudo apt-Get install sun-java5-jdk

Copy code

After update, use sudo apt-Get install sun-java5-jdk

Load JDK environment variables:

  1. 1. sudo gedit/etc/profile
  2. 2. Export java_home =/usr/lib/JVM/Java-5-sun
  3. 3. Export Path = $ path: $ java_home/bin
  4. 4. Export classpath = $ java_home/lib

Copy code

Create a directory for storing andorid and create a bin directory in it.

  1. 1. mkdir android
  2. 2. CD android
  3. 3. mkdir Bin
  4. 4. CD Bin
  5. 5. Curl [url] http://android.git.kernel.org/repo#/url]> Repo
  6. 6. sudo chmod A + x repo // Modify permissions
  7. 7. CD .. // return to the previous layer: Return to the android directory

Copy code

Then, create a directory for saving the source code in the android directory. My name is androidsrc.
Mkdir androidsrc
CD androidsrc
../Bin/repo init-u git: // android.git.kernel.org/platform/manifest.git
After the settings are complete, start to synchronize the code
../Bin/repo sync

Load Android environment variables:

  1. 1. sudo gedit/etc/profile
  2. 2. Export android_java_home = $ java_home
  3. 3. Export Path = $ path:/home/Heji/Android/androidsrc/out/host/linux-x86/bin
  4. 4. Export android_product_out =/home/Heji/Android/androidsrc/out/target/product/generic

Copy code

  1. 1. sudo gedit/home/Heji/. bashrc
  2. 2. Export Path = $ path :~ /Android/androidsrc/out/host/linux-x86/bin
  3. 3. Export android_product_out = ~ /Android/androidsrc/out/target/product/generic

Copy code

Source code compilation:
After the download is complete, go to the androidsrc directory, make, compile the source code, and compile the SDK as make SDK.

Start the simulator:
Go to the androidsrc directory and enter the command: emulator

Module Compilation:
Run. Build/envsetup. Sh (required) in the androidsrc directory)
Mmm packages/apps/contacts/compile contacts

Directory out/target/product/generic/system/APP/contacts.apk
To directly test the changes, you need to generate a new system. IMG and run the following command in the android directory:
Make Snod (under the androidsrc directory)
Of course, if you change emulator or other peripheral-related things, instead of internal system things, you don't just need to regenerate system. IMG. (Text/Heji)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.