Aosp官方教程
Ubuntu18.0.4下載ubuntu-18.04.5-desktop-amd64.iso
創(chuàng)建Ubuntu虛擬機
自定義高級=>安裝程序光盤映像文件(iso)=>輸入虛擬機名稱核畴、賬號密碼=>各種虛擬機配置=>創(chuàng)建新虛擬磁盤=>將虛擬磁盤拆分成多個文件=>耐心等待
為Ubuntu開啟ssh服務
//查看是否安裝ssh服務,若出現(xiàn)connect to host localhost port 22: Connection refused則表示未開啟ssh服務
ssh localhost ssh
//開啟ssh服務
sudo apt-get install openssh-server
//啟動ssh服務
sudo /etc/init.d/ssh start
設置ubuntu為靜態(tài)ip
ifconfig查看網(wǎng)卡名稱
1.sudo nano /etc/network/interfaces 修改內(nèi)容為:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.1.23
netmask 255.255.255.0
gateway 192.168.1.99
2.sudo nano /etc/resolv.conf 修改內(nèi)容為nameserver 8.8.8.8
3.service networking restart 重啟網(wǎng)卡,如果報錯直接重啟電腦,然后再按照第2部操作即可。
安裝中文輸入法
sudo apt-get install fcitx-bin
sudo apt-get install fcitx-table
打開ubuntu的settings=>Region&Language=>Manage Installed Languages=>RemindMeLater
先點擊Install/Remove Language兄淫,把Chineses(simplified) 選進去后,點apply,再點Apply system-wide后重啟系統(tǒng)
運行apt get報錯如下:
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
可以這樣解決:
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock
aosp8.1.0+ubuntu18.0.4 源碼編譯
安裝依賴:
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
修改為中科大源
//進入到/etc/apt:備份sources.list
ruin@ubuntu:/etc/apt$ sudo cp sources.list sources.list.bak
nano sources.list添加sources.list的源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
更新源
sudo apt-get update
安裝python
//確保python2和python3都安裝
apt-get install python
apt-get install python3
安裝 Repo
sudo nano /etc/profile
export PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
同步中科大源aosp版本號
中科大aosp開源鏡像
// cd到自己創(chuàng)建的目錄
cd /home/ruin/Desktop/AOSP8.1.0
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.1.0_r1
如果遇到下面錯誤,則需要編輯bash.rc,然后退出終端再打開終端
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out
fatal: cloning the git-repo repository failed, will remove '.repo/repo'
ruin@ubuntu:~$ sudo nano .bashrc
//把下面命令復制到.bashrc文件中并重啟終端
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
重新運行repo,并設置郵箱
git config --global user.email "Ruin@example.com"
git config --global user.name "Ruin"
PATH=~/bin:$PATH
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.1.0_r1
下載源碼
ruin@ubuntu:~/Desktop/AOSP8.1.0$repo sync -j4