首页 ubuntu-android-download(Ubuntu Android下载)

ubuntu-android-download(Ubuntu Android下载)

举报
开通vip

ubuntu-android-download(Ubuntu Android下载)ubuntu-android-download(Ubuntu Android下载) ubuntu-android-download(Ubuntu Android下载) As an open source mobile phone operating system Android, once launched, it has attracted great concern in the industry. Google now Android source code version number is 1.50r...

ubuntu-android-download(Ubuntu Android下载)
ubuntu-android-download(Ubuntu Android下载) ubuntu-android-download(Ubuntu Android下载) As an open source mobile phone operating system Android, once launched, it has attracted great concern in the industry. Google now Android source code version number is 1.50r1. More and more enthusiasts began to join the Android source code research, the following on Ubuntu 9.04, if you get the latest Android source code. 1. installing GIT and gnupg. input $sudo apt-get install git-core gnupg 2. install other tools $sudo apt-get install flex bison GPERF libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip zlib1g-dev curl libncurses5-dev 3. install Valgrind tools $sudo apt-get install Valgrind 4. install Java SDK $sudo apt-get install sun-java6-jdk $sudo apt-get install sun-java5-jdk $cd /etc/alternatives $sudo RM javadoc.1.gz Javadoc $sudo ln -s /usr/lib/jvm/java-1.5.0-sun/man/man1/javadoc.1.gz javadoc.1.gz $sudo ln -s /usr/lib/jvm/java-1.5.0-sun/bin/javadoc Javadoc Android only supports more than 1.5 versions of Java SDK, and the 1.6 version of the Java SDK in Android SDK Java doc will compile time errors, here in my solution to install Java SDK 1.6, and then install Java SDK 1.5, then Java SDK system link to Java SDK 1.6, is only Javadoc and javadoc.1.gz link to Java SDK 1.5, the benefits of doing so is to compile the Android source code and Android application development, using java SDK 1.6, SDK doc only in the Android compiler, using java SDK 1.5 version of Javadoc and javadoc.1gz. 5. download repo tools $mkdir $HOME/bin $vi.Bashrc join Export PATH=$HOME/bin:$PATH $source.Bashrc $curl ; $HOME/bin/repo $CD $HOME/bin $Chmod +x repo 6. export Android project $CD $MKDIR Android $CD Android $repo init -u git://android.git.kernel.org/platform/manifest.git And complete the configuration of the prompt so that the directory we built has already been linked to the Android Google source library. 7. start downloading Android platform source code $repo sync Because the Android source code is very large, now the complete code has reached as high as 3G, so the most sub folder for synchronous download. If you want to download kernel: $repo sync kernel Now, you can do something else, let the computer automatically complete source code download work. This operation is to download the entire Android source to the local, the specific time spent and speed related, Cupcake version of the source code is about 1.3G. You can see the Android source code into the $HOME/Android/ directory as follows: --repo is a series of file synchronization management used Some libraries need --bionic --Android compilation process Some of the files --bootable - responsible for starting and backup Some of the makefile's main --build and compiler configuration files --dalvik - after Java Google virtual machine optimized. With the development of --development -- some folders, including simulators and tools etc. The introduction of external function library in --Android --external --frameworks -- middleware part Some support files, the --hardware -- and the hardware including WiFi, telecommunications module etc. --kernel - after optimization and modification of the Linux kernel --packages -- all of the top application packages --prebuild --Android compiler tools directory --system -- some system level files @ @ @ Kernel is to separate repo init; repo sync. The address is different. The apt-get command generally requires root permission to execute, so generally follow the sudo command. Sudo apt-get install git-core curl This command will install git-core and curl software from the Internet in the warehouse. Where curl is a file transfer tool using URL syntax to work at the command line, it supports many protocols, including FTP, FTPS, HTTP, HTTPS, TELENT and so on, we need to install it for Repo script file from the network. Curl ;~/bin/repo This command will download the repo script file to the /bin directory of the current home directory and save it in the file repo. Finally, we need to give repo executable file permissions Chmod a+x ~/bin/repo Next, we can use repo scripts and Git, curl software to obtain the source code of Android: First, build a directory, such as ~/android. Then use the following command to obtain the source code: Repo init - u git://android.git.kernel.org/platform/manifest.git This process will continue for a long time (I downloaded a day), after downloading repo initialized in /android will see this suggests that local repository has been initialized, and contains the latest sourcecode. If we want to take the code of a branch version, rather than the mainline code, we need to specify the name of branch using the -b parameter, for example: Repo init – u git://android.git.kernel.org/platform/manifest.git – B Cupcake If we just want to get a project code, such as kernel/common, do not need repo script, you can directly use the Git tools, if carefully studied the repo script, the repo script is actually Git tools to get each Project and organize them into a project in Android. Git clone git://android.git.kernel.org/kernel/common.git We use the repo script to get all the projects, and then we need to synchronize the entire Android code tree to the local, as follows: Repo sync project1 project2... I use the repo sync command directly to the local synchronization of all items. Two, source code compilation After all the synchronization is finished, enter the Android directory, and use the make command to compile, you will find the following error prompts: Host C: libneo_cgi external/clearsilver/cgi/cgi.c External/clearsilver/cgi/cgi.c:22:18: error: zlib.h: No such file or directory This is because we lack zlib1g-dev, and we need to install it from the software repository using the apt-get command, as follows: Sudo apt-get install zlib1g-dev Similarly, we also need the following software installed Sudo apt-get install flex Sudo apt-get install bison Sudo apt-get install GPERF Sudo apt-get install libsdl-dev Sudo apt-get install libesd0-dev Sudo apt-get install libncurses5-dev Sudo apt-get install libx11-dev After the above software is installed, run the make command to compile the Android source code again. This time you will find a lot of java files can not compile errors, Open the Android source code, we can see that there are a lot of Java source files under android/dalvik/libcore/dom/src/test/java/org/w3c/domts, which means that before compiling Android, you need to install JDK. First, from the sun official website to download the jdk-6u16-linux-i586.bin file and install it. In Ubuntu 8.04, the /etc/profile file is a global environment variable configuration file that applies to all shell. When we go to the Linux system, the /etc/profile file to start first, and then start the user directory under the ~/.bash_profile, ~/.bash_login or ~/.profile files in one order, and executed the order. If the ~/.bash_profile file exists, the general will execute the ~/.bashrc file. So we only need to put the JDK into the /etc/profile directory, as follows: JAVA_HOME=/usr/local/src/jdk1.6.0_16 PATH=$PATH:$JAVA_HOME/bin:/usr/local/src/android-sdk-linux_x86-1.1_r1/tools:~/bin Then restart the machine, and enter the Java – version command, which prompts the following information to represent the configuration success: Java version "1.6.0_16"" Java (TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot (TM) Client VM (build 14.2-b01, mixed mode, sharing) To compile the complete project, the terminal will appear as below: Target system FS image: out/target/product/generic/obj/PACKAGING/systemimage_unopt_ intermediates/system.img Install system FS image: out/target/product/generic/system.img Target ram disk: out/target/product/generic/ramdisk.img Target UserData FS image: out/target/product/generic/userdata.img Installed file list: out/target/product/generic/installed-files.txt Root@dfsun2009-desktop:/bin/android# Three, source operation After compiling the complete project, if we need to watch the compiled operation effect, then we need to install the simulator android-sdk-linux_x86-1.1_r1 in the system, and the download address of this SDK is: Linux: Mac: Windows: After decompression, you need to add the /usr/local/src/android-sdk-linux_x86-1.1_r1/tools directory to the system environment variable /etc/profile. Then find the compiled Android file directory out, we found that in many android/out/host/linux-x86/bin applications, the foundation of these applications is to Android, so we need to put this directory is also added to the PATH system, add the following in the $HOME/.Profile file: PATH= $PATH:$HOME/android/out/host/linux-x86/bin" Next, we need to load the mirror file of Android into emulator so that emulator can see the actual effect of Android running and add the following contents in the $HOME/.profile file: ANDROID_PRODUCT_OUT=$HOME/android/out/target/product/generic Export ANDROID_PRODUCT_OUT Then restart the machine. Here you can enter the directory and launch the simulator simulator CD $HOME/android/out/target/product/generic Emulator -image system.img -data userdata.img -ramdisk ramdisk.img Summarize the key points in the installation process: The 1:JDK version must be installed 2: use the following command to ensure that the required software is properly installed Sudo apt-get install flex bison GPERF libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential Python git Valgrind curl 3: memory and virtual memory guarantee more than 2GB, you can use the command line free -m to see if the memory is enough, if the memory is not enough, terminal stagnation @ @ @ Compiling environment Ubuntu 9.04 Desktop Download and compile processes According to 's instructions, all the source code was downloaded successfully, and the whole directory file was close to 2G Preliminary preparation: Install the GIT tool apt-get install git-core kernel, sudo command 1. download repo tools Curl ; $HOME/bin/repo CD $HOME/bin Chmod +x repo 2. export Android project MKDIR Android CD Android Repo init -u git://android.git.kernel.org/platform/manifest.git -b Cupcake (if there is no error, 5 minutes should prompt success, related to network speed) 3. download the source code of Android platform Repo sync (this will last for a period of time, with your own speed) 4. compiler, suggest to install software packages are as follows (using the apt-get installation) Flex bison GPERF libsdl-dev libesd0-dev curl libncurses5-dev zlib1g-dev libx11-dev 5. compiler Make (very long wait, and your CPU speed has a certain relationship, suggesting that it is compiled before sleep) When compiling the following source code needs to add the corresponding header files (include) /android/cupcake/frameworks/base/tools/aidl/aidl.cpp string.h, stdlib.h /android/cupcake/frameworks/base/tools/aidl/options.cpp string.h /android/cupcake/frameworks/base/tools/aidl/search_path.h string, string.h /android/cupcake/frameworks/base/tools/aidl/generate_java string.h /android/cupcake/external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h string.h /android/cupcake/external/srec/tools/thirdparty/OpenFst/fst/lib/symbol-table.cpp string.h /android/cupcake/build/tools/atree/files.cpp string.h, stdlib.h /android/cupcake/build/tools/atree/fs.cpp string.h /android/cupcake/frameworks/base/tools/localize/file_utils.cpp string.h, stdlib.h /android/cupcake/frameworks/base/tools/localize/localize.cpp string.h, stdlib.h /android/cupcake/frameworks/base/tools/localize/Perforce.cpp string.h, stdlib.h /android/cupcake/frameworks/base/tools/localize/XLIFFFile.cpp iostream, algorithm /android/cupcake/frameworks/base/tools/localize/XMLHandler.cpp iostream, algorithm /android/cupcake/development/emulator/qtools/dmtrace.cpp unistd.h The compiler is completed, will be found in the code directory has a out directory Six Set up the operating environment ($HOME/.profile files), add the following content # Android PATH= $PATH:$HOME/android/out/host/linux-x86/bin" ANDROID_PRODUCT_OUT=$HOME/android/out/target/product/generi c Export ANDROID_PRODUCT_OUT After setup, quit and login again 7. run with virtual machines CD $HOME/android/out/target/product/generic Emulator -image system.img -data userdata.img -ramdisk ramdisk.img You should see the following picture (the first time it opens, there should be a dialog box to Google feedback, press OK)
本文档为【ubuntu-android-download(Ubuntu Android下载)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_215732
暂无简介~
格式:doc
大小:40KB
软件:Word
页数:12
分类:生活休闲
上传时间:2019-01-08
浏览量:37