Android source code and kernel source code download, compile and run

Source: Internet
Author: User

The author tries to download, compile and run the Android source code and the kernel source code according to Luo Shenyang Teacher's "Android system source code Scenario analysis" book. But it could be the reason that the software source was "walled" or updated, and there were many issues during the period. The author turned to the powerful Niang and Google, finally compiled successfully, the steps are now to revise the following records:
I. Download the relevant toolkit and dependency packages
1.git tool Download, not much to say
2.Java SDK Download (reference URL: http://blog.csdn.net/zjclugger/article/details/11762085)
Download jdk1.6.0_41 is recommended here
3. Download of other dependent packages
in other dependent packages, the installation of Libwxgtk2.6-dev will be problematic, and the toolkit version will be changed to Libwxgtk2.8-dev
Note: There are some toolkit download can not find the package problem, at this time can change the source of software, I was using Huazhong University of Technology software source Http://mirrors.hust.edu.cn/ubuntu, pro-Test available.

two. Download Android source code
combined with the contents of the book and blog http://www.cnblogs.com/bluestorm/p/4419135.html can be successfully downloaded
1. Download Repo
1) Create repo directory
mkdir ~/bin
Path=~/bin: $PATH

2) Download repo (official repo can not download, the other repo mostly older, this time relatively new)
git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/


3) Copy the repo file from the Git-repo to the bin directory after cloning
CP Git-repo/repo ~/bin/

4) Modify the repo file and set the Repo_url as follows:
Repo_url = ' Git://aosp.tuna.tsinghua.edu.cn/android/git-repo '

2. Initialize Repo

1) Create the Android directory and enter

mkdir Android

CD Android

2) Initialize Repo

Repo Init-u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest-b ANDROID-2.3.1_R1


PS: At the time of initialization, if the prompt needs email authentication, use the following command, and then re-command:
git config--global user.email "[Email protected]"


git config--global user.name "Your name"

3) Synchronous Repo

Repo Sync

After waiting for some time (longer), the Android source code is downloaded successfully. The list of files in the Android directory is as follows:



Third, compile the Android source code

Execute make command .... But this is far from enough, will encounter various problems and error. At this time with the help of Niang can.

The author of some common errors and solutions listed below, I hope we can have some help

1.


Workaround: sudo apt-get install libc6-dev-i386


2.





3.


4.

5.



6.

7.




8.


9. After compiling successfully, get the result:


10. Compile the Sdkmake SDK, this step is not a problem

four. Run the Android emulator
1. Configure Environment variables
Export path= $PATH: ~/android/out/host/linux-x86/bin
Export Android_product_out=~/android/out/target/product/generic2. Run simulator
Emulator commands (You can also specify kernel, system, data, and RAMDisk, as the author shows.) If not specified, the default is used). However, you will often encounter the following problems:
This can be resolved by the following command: sudo apt-get install libsdl1.2debian:i386, as shown in:


five. Download the Android kernel source code
1. Create a new kernel folder and enter
mkdir kernel
CD kernel
2. Manually execute git command download: Git clone http://android.googlesource.com/kernel/goldfish.git
However, there will be a problem, prompt: Remote Error:ssl is required, as shown:

Solution: Modify "http" to "https" as shown in:

3.git Checkout remotes/origin/android-goldfish-2.6.29

Six. Compiling Android kernel source code
Here according to the steps in the book, there should be no problem, omitted here

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android source code and kernel source code download, compile and run

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.