深入理解Android 读感(一)

一、环境搭建

1.准备工作

  1)VMware下安装Ubuntu(个人使用是ubuntukylin-16.04.2-desktop-amd64 http://www.ubuntu.org.cn/download/ubuntu-kylin)

##https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cdimage/ubuntukylin/releases/16.04.2/release/#

    小注:

    a)个人电脑使用ROOT登录系统,减少命令输入 切换的方法先修改root密码

sudo passwd

    b)使用root使用登录ubuntu

      进入 /usr/share/lightdm/lightdm.conf.d/

      编辑: 50-unity-greeter.config

      添加如下代码,保存退出      

user-session=ubuntu
greeter-show-manual-login=true
all-guest=false

      重启ubuntu-kulin

    c)开机出现错误“Error found when loading /root/.profile”解决

      #gedit /root/.profile,打开文件后找到“mesg n”,

      将其更改为

tty -s && mesg n

   2)安装编译依赖的软件 

apt-get install vim git-core curl

  3)下载安装repo(https://code.google.com/p/git-repo/)

    a)创建repo目录并临时加入环境变量(http://source.android.com/source/downloading.html#installing-repo)     

mkdir ~/bin
PATH=~/bin:$PATH

    b)下载repo并给予运行权限

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

    c)建立工作目录

mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY

    d)用姓名和电子邮件地址配置Git 

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

    e)执行repo获取最新的manifest或某个分支(分支列表http://source.android.com/source/build-numbers.html#source-code-tags-and-builds)

repo init -u https://android.googlesource.com/platform/manifest
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

    f)将安卓源码同步到工作目录

repo sync

g)h)

原文地址:https://www.cnblogs.com/iluoye/p/5210554.html