ubuntu 16.04 编译android source

环境配置:

1.  安装ubuntu 16.04 系统

    不同的版本,会有不同的依赖库,其它ubuntu版本请参考对应版本的安装步骤.

    UEFI 启动模式安装ubuntu

        网上有很多安装文章(自己硬盘分区),不过测试都没有成功,最终傻瓜式的一路安装成功.

        简述步骤:插入准备好的UEFI 模式usb启动盘,惠普PC按F10 进入BIOS,选择UEFI USB盘启动,之后一路傻瓜安装(安装       类型选择"清除整个磁盘并安装ubuntu").

2.安装openjdk

sudo apt-get updatesudo apt-get install openjdk-8-jdk
3. 安装依赖库

sudo apt-get install git-core gnupg flex bison gperf build-essential  
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install lib32z-dev ccache
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip
sudo apt-get install libssl-dev
sudo apt-get install python-requests
4. 安装repo
  1. Make sure you have a bin/ directory in your home directory and that it is included in your path:

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

    curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repochmod a+x ~/bin/repo
  3.    设定环境变量 
      ~/.bashrc 文件末尾添加:PATH=~/bin:$PATH
5. 配置git(默认git编辑器为emacs)
     
git config --global user.name "Your Name"git config --global user.email "you@example.com"
git config --global core.editor vim
6. Sync 代码 以及build代码(这部分网上很多资料,不细写)

     注意的部分:  jack-server out of memory

$ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8

-XX:+TieredCompilation -Xmx8192m"

$ out/host/linux-x86/bin/jack-admin kill-server

$ out/host/linux-x86/bin/jack-admin start-server


7. 安装android studio(启动的时候会自动下载sdk 工具)

     查找adb下载的位置,并设置环境变量,这样可以通过adb操作手机.

     例如:~/.bashrc中的修改部分

          PATH=~/tool/bin:~/bin:$PATH
          PATH=~/Android/Sdk/platform-tools:$PATH

8. Reference

https://source.android.com/setup/build/downloading

https://source.android.com/setup/build/initializing

https://www.cnblogs.com/wanqieddy/archive/2012/08/03/2621027.html

https://blog.csdn.net/fuchaosz/article/details/51487585/

https://www.cnblogs.com/tsts/p/7554703.html

https://blog.csdn.net/ztguang/article/details/52853397

https://developer.android.com/studio/index.html



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值