according to Luo Shenyang Teacher's "Android system source Scenario analysis" a book, try to download, compile and execute Android source code and kernel source code. But it could be the reason the software source was updated by the wall or version number. Encountered many problems during the period. I turn to the strong degree Niang and Google. The final compilation succeeds, and now the steps for the change are recorded such as the following:
I. Download the relevant toolkit and dependency packages
download of 1.git tools. Not much.
download of the 2.Java SDK (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 fails, and the toolkit version number is changed to Libwxgtk2.8-dev to
Note: Some toolkit downloads can cause problems with packages not found, which can change the source of the software at this time. I am using the software source Http://mirrors.hust.edu.cn/ubuntu of Huazhong University of Science and Technology. The pro-test is 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 folder
mkdir ~/bin
Path=~/bin: $PATH
2) Download repo (the official repo can not download.) Most of the other repo are older. This time is relatively new)
git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/
orgit clone git:
//git
.omapzoom.org
/git-repo
.git
3) Copy the repo file from the Git-repo to the bin folder after cloning
CP Git-repo/repo ~/bin/
4) Change the repo file, set the Repo_url for example:
Repo_url = ' Git://aosp.tuna.tsinghua.edu.cn/android/git-repo '
2. Initialize Repo
1) Create the Android folder 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: When initializing, if you need email authentication, use the following command, for example. And again the above command:
git config--global user.email "[Email protected]"
git config--global user.name "Your name"
3) Synchronous Repo
Repo Sync
After waiting for a long time (longer), the Android source code will be downloaded successfully.
The list of files in the Android folder is now as follows:
Third, compile Android source code
Run the Make command.
。。。 But that's far from enough. Will encounter various problems and errors. At this time with the help of Niang can.
The author lists some common errors and solutions such as the following. Hope to have some help for everyone
1.
Workaround: sudo apt-get install libc6-dev-i386
2.
3.
4.
5.
6.
7.
8.
9. After the compilation is successful. Get the results:
10. Compile the Sdkmake SDK. There's nothing wrong with this step.
four. Execute Android emulator
1. Configure Environment variables
Export path= $PATH: ~/android/out/host/linux-x86/bin
Export Android_product_out=~/android/out/target/product/generic2. Execution simulator
The emulator command (can also specify kernel, system, data, and RAMDisk. As I have seen. If not specified, the default is used). However, you will often encounter issues such as the following:
This can be resolved by, for example, the following command: sudo apt-get install libsdl1.2debian:i386. For example, as seen in:
five. Download the Android kernel source code
1. Create a new kernel directory and enter
mkdir kernel
CD kernel
2. Manually run git command download: Git clone http://android.googlesource.com/kernel/goldfish.git
But there will be a malfunction. Hint: remote ERROR:SSL is required. For example, as seen in:
Workaround: Change "http" to "https", for example, as you can see:
3.git Checkout remotes/origin/android-goldfish-2.6.29
Six. Compiling Android kernel source code
Here follow the steps in the book. There should be no problem. omitted here
Android source code and kernel source download, compile and execute