欢迎来到天天文库
浏览记录
ID:4158095
大小:171.27 KB
页数:19页
时间:2017-11-29
《android编译大全 完全指南》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Android编译大全Android编译大全(一)1.编译前的准备1.1.编译环境准备v先构建一个Ubuntu9.10虚拟机v在虚拟机中确认下面的包是否已经安装:nsudoapt-getinstallbuild-essentialnsudoapt-getinstallmakensudoapt-getinstallgccnsudoapt-getinstallg++nsudoapt-getinstalllibc6-devnsudoapt-getinstallflexnsudoapt-getinstallb
2、isonnsudoapt-getinstallpatchnsudoapt-getinstalltexinfonsudoapt-getinstalllibncurses-devnsudoapt-getinstallgit-coregnupg//(gnupg系统可能已自带)nsudoapt-getinstallflexbisongperflibsdl-devlibesd0-devlibwxgtk2.6-devbuild-essentialzipcurlnsudoapt-getinstallncurses-
3、devnsudoapt-getinstallzlib1g-devnsudoapt-getinstallvalgrindnsudoapt-getinstallpython2.5(Ubuntu可能已经自带)nsudoapt-getinstallsun-java5-jdk(Ubuntu9.10里面已经用1.6替换了1.5,需要重新下载一个1.5)v下载repo脚本,加上可执行权。n$curlhttp://android.git.kernel.org/repo>repon$sudochmoda+xrepo注:
4、本文档以Froyo版本为基础进行编译。1.2.Sourcecode的获取v在源码存放目录android中执行$repoinit-ugit://codeaurora.org/platform/manifest.git-bcarrot.cupcake-mM7201JSDCBALYA6380.xml就可以获得代码了关于-b和-m参数的说明参见:https://www.codeaurora.org/wiki/QAEPv执行reposync就可以开始下载源码了$reposync(漫长的过程,视速度而言需要半天以
5、上)Android编译大全(二)2.编译源代码v执行ls-la/bin/sh命令,如果输出如下:rwxrwxrwx1rootroot42010-02-1017:14/bin/sh->dash请执行$sudodpkg-reconfiguredash命令修改sh版本,并选择“否”;此处如果不改好的话,编译时会出现错误。v执行sourcebuild/envsetup.sh命令v执行choosecombo命令,出现选择对话框uBuildforthesimulatororthedevice?u1.Deviceu
6、2.SimulatoruuWhichwouldyoulike?[1]uuBuildtypechoicesare:u1.releaseu2.debuguuWhichwouldyoulike?[2]uuProductchoicesare:u1.coreu2.full_dreamu3.fullu4.full_passionu5.full_sapphireu6.generic_dreamu7.genericu8.generic_passionu9.generic_sapphireu10.msm7625_qrd
7、u11.msm7627_ffau12.msm7627_surfu13.msm7630_surfu14.qsd8250_ffau15.qsd8250_surfu16.sample_addonu17.sdku18.simuYoucanalsotypethenameofaproductifyouknowit.uWhichproductwouldyoulike?[generic]3uuVariantchoicesare:u1.useru2.userdebugu3.enguWhichwouldyoulike?[
8、eng]如果执行这个命令的时候,报错:/bin/sh:Syntaxerror:"("unexpected#请执行$sudodpkg-reconfiguredash命令,并选择“否”;v配置环境变量exportJAVA_HOME=/usr/lib/jvm/java-5-sunexportCLASSPATH=$JAVA_HOME/libexportJRE_HOME=$JAVA_HOME/jreexportJAVA_PATH=$JAVA_HOME/bin:$J
此文档下载收益归作者所有