VMware安装Ubuntu12.04成功编译android4.0.3源码

VMware安装Ubuntu12.04成功编译android4.0.3源码

安装Ubuntu

Ubuntu系统可以通过官网下载,编译源码至少准备100G。

参考文章:https://blog.csdn.net/hong2511/article/details/81270824

环境配置

  1. 安装jdk(本次编译安装的jdk1.6)
  2. 建议先安装以下软件,否则编译过程中会出错,也可以出问题再安装
    sudo apt-get install gnupg flex bison gperf libsdl1.2-dev libesd0-dev
    sudo apt-get install libwxgtk2.6-dev squashfs-tools build-essential
    sudo apt-get install zlib1g-dev pngcrush schedtool ia32-libslibncurses5-dev

下载源码

  1. 安装git:apt-get install git

  2. 配置git的用户名和邮箱
    git config --global user.name “Your Name”
    git config --global user.email "email@example.com"

  3. 安装curl :apt-get install curl

  4. $ mkdir ~/bin 创建bin目录

  5. PATH=~/bin:$PATH 添加到PATH环境变量中

  6. 下载repo
    curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    curl “http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo”>/bin/repo
    上面两个都是了但是都下载失败了,本人用下面的成功下载。
    curl http://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    下载成功后再/bin目录下面就会有一个repo文件(命令行到bin目录查看)

  7. chmod a+x ~/bin/repo

  8. 创建源码下载文件夹 mkdir android_source

  9. cd android_source

  10. 下载源码
    repo init -u https://android.googlesource.com/platform/manifest
    挑选一个喜欢的版本https://android.googlesource.com/platform/manifest/+refs
    然后输入repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
    因为种种原因导致谷歌地址无法访问,选择国内镜像源(科大源、清华源等等)
    清华源
    repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
    repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-4.0.3_r1

  11. 下载源码 repo sync

编译源码

  1. cd android_source PS:第二次编译前要make clean)
  2. source build/envsetup.sh
  3. lunch
  4. 默认选第一个() Enter键继续
  5. make -jn (n建议用cpu核心的2倍,VMware中配置的是2,make -j4)
    当看到 ### make completed successfully表示编译成功。

ps: 编译过程中遇到问题请参考 https://blog.csdn.net/u011422742/article/details/52068327

运行模拟器

  1. source build/envsetup.sh
  2. lunch (选择刚才你设置的目标版本,比如这里了我选择的是1 full-eng,这里就是 lunch full-eng)
  3. emulator
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值