我的android-4.1.1_r1下载-编译-ok

Get Android Source Code 20130702

http://source.android.com/source/downloading.html

1.Install REPO tool
     1> Make sure you have a ~/bin/ directory in your home directory
      $ mkdir ~/bin
     2> Make sure that this bin directory is in your path
      $ export PATH=~/bin:$PATH
      $ echo $PATH

2.Install REPO tool (2/2)
     1> Download REPO tool and make it executable:
       $ curl http://android.git.kernel.org/repo >~/bin/repo
       $ chmod a+x ~/bin/repo

3.Initializing a Repo client
     1> Create an empty directory
       $ mkdir WORKING_DIRECTORY
       $ cd WORKING_DIRECTORY

4.Run repo init
       $ repo init –u https://android.googlesource.com/platform/manifest -b android- 2.3.7_r1 (具体下载哪个版本根据个人需要)

5.Getting the files
   $ repo sync


下载android代码过程中,提示以下错误:
error: Failed connect to android.googlesource.com:443;Connection refused while accessing https://android.googlesource.com/a/platform/frameworks/base/info/refs
fatal: HTTP request failed
解决方法:编辑/etc/hosts文件
$ vim /etc/hosts
增加下面内容,保存
74.125.31.82         www.googlesource.com
74.125.31.82         android.googlesource.com
203.208.46.172    cache.pack.google.com
59.24.3.173           cache.pack.google.com
然后重新输入
$ repo sync
可以继续下载了。我的android-4.1.1_r1前后下载了约8个小时.

在WORKING_DIRECTOR下直接make,编译了4.5h后出现
make: *** [out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes-full-debug.jar] Error 41

20130718晚上,在原路径下执行命令make -j4后, 又编译了1.5个小时,没报错。
20130719上午继续make -j4,大约编译80分钟,编译完成。在out/target/product/generic下生成了system.img/ ramdisk.img/ userdata.img三个映像文件。


使用emulator命令,提示找不到命令。执行
$source build/envsetup.sh
$lunch full-eng
再输入命令emulator后,android-4.1.1仿真界面出现。证明编译ok.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值