排坑之android 运行环境搭建及编译运行

来源:互联网 发布:女用情趣用品 知乎 编辑:程序博客网 时间:2024/05/18 17:03

android soruce guide html: http://source.android.com/source/initializing.html

官网的一些介绍过于笼统,个人觉得有必要进行一次tips 更正。


1、硬盘大小的准备吐槽

Note: The source download is approximately 8.5GB in size.You will need over 30GB free to complete a single build, andup to 100GB (or more) for a full set of builds.


8.5G太小了,现在的高版本安卓至少要准备20G的代码空间。如果按照多下1套的代码量来看,代码就得准备40G左右,加上2*30=60G的代码中间件生成空间。已经是100G了,

加上ccache最大100G,那基本得准备200G的硬盘空间。这个空间的准备对于安装双系统(xp+ubuntu以及win7+ubuntu)的同学来讲都是需要认真估算准备的。

打个小广告:

win7+ubuntu双系统安装

xp硬盘上安装ubuntu12.04双系统

2、Installing the JDK吐槽

只告诉你这些,但是并没有清楚的告诉尔等,老版本的jdk1.6是需要使用sun jdk而不是openjdk.我边写边想揍人!

Java 7: For the latest version of Android

To develop older versions of Android, download and install the corresponding version of theJava JDK:
Java 6: for Gingerbread through KitKat
Java 5: for Cupcake through Froyo


3、编译链安装环境未更新说明

ubuntu12.04.4版本安装 libgl1-mesa-glx:i386的时候提示如下,应该将libglapi-mesa:i386加入依赖关系中。

下列软件包有未满足的依赖关系:
 libgl1-mesa-glx:i386 : 依赖: libglapi-mesa:i386 (= 8.0.4-0ubuntu0.7)
                        推荐: libgl1-mesa-dri:i386 (>= 7.2)


4、repo吐槽

To install Repo:

  1. Make sure you have a bin/ directory in your home directory and that it is included in your path:

    $ mkdir ~/bin$ PATH=~/bin:$PATH
  2. Download the Repo tool and ensure that it is executable:

    $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo

For version 1.17, the SHA-1 checksum for repo is ddd79b6d5a7807e911b524cb223bc3544b661c28

For version 1.19, the SHA-1 checksum for repo is 92cbad8c880f697b58ed83e348d06619f8098e6c

For version 1.20, the SHA-1 checksum for repo is e197cb48ff4ddda4d11f23940d316e323b29671c

For version 1.21, the SHA-1 checksum for repo is b8bd1804f432ecf1bab730949c82b93b0fc5fede

被墙不是你的错,但是麻烦你将以前的一些repo版本项目删除可以否,直接curl googleapis网址失败,但是搜索到一个旧的repo维护googlesource项目,下载了一个

version 1.19的repo,在repo sync的时候总是报gpg:无法检查签名:找不到公钥。后来用SHA-1 了一下下载到的1.19版本果然 SHA-1 checksum与最新的说明中不一致了,坑爹!5、代理设置吐槽

Troubleshooting network issues


When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

仅仅是这样设置是远远不够的,goagent怎么翻墙代理我就不说了。关键是:git http_proxy https_proxy你压根就没提啊!!!你那人家怎么代理下载!


如何使用代理帐号下载Android源代码

git config --global http.proxy http://127.0.0.1:8087(以你自己的代理为准)

git config --global https.proxy http://127.0.0.1:8087(以你自己的代理为准)



6、模拟器的运行(肯无止境)

source build/envsetup.sh

lunch aosp_arm-eng
make -j4

Emulate an Android Device

The emulator is added to your path automatically by the build process. To run the emulator, type

$ emulator

第一次是没错啊!可以运行模拟器,但是你多讲几句话会死人吗?我关掉命令行下次重新想启动模拟器的话,麻烦告诉我等:(还需要

source build/envsetup.sh 以及launch步骤好不好)

source build/envsetup.sh
lunch aosp_arm-eng
$ emulator



0 0
原创粉丝点击