参考:https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
Ubuntu 16.04 编译Android 8
安装依赖:
sudo apt-get install openjdk-8-jdk git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven
1.将repo中goole的连接
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
修改为清华的连接
REPO_URL = 'https://aosp.tuna.tsinghua.edu.cn/android/git-repo'
2.初始化
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.1_r22
manifest见 https://android.googlesource.com/platform/manifest
可加上--depth参数:(--depth=DEPTH create a shallow clone with given depth; see git clone)
repo init --depth=1 -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-9.0.0_r48
3.下载
repo sync
或者
repo sync -c --no-clone-bundle --no-tags -j$(nproc)
- -c, --current-branch fetch only current branch from server
- --no-clone-bundle disable use of /clone.bundle on HTTP/HTTPS
- --no-tags don't fetch tags in the manifest
通过在init及sync时添加额外参数可明显减小代码量,以android-9.0.0_r48为例,不添加额外参数,.repo目录大小为31G,而使用额外参数后大小仅为14G。
Telephony相关库:
frameworks/opt/telephony
frameworks/base
packages/providers/TelephonyProvider
packages/services/Telecomm
packages/services/Telephony
packages/services/Mms
packages/apps/Dialer
packages/apps/Phone
packages/apps/PhoneCommon
packages/apps/BasicSmsReceiver
packages/apps/Contacts
packages/apps/ContactsCommon
packages/providers/ContactsProvider
frameworks/opt/net/ims
frameworks/opt/net/voip
packages/apps/Settings
packages/apps/Stk
packages/apps/Messaging
repo sync -j8 frameworks/opt/telephony frameworks/base packages/providers/TelephonyProvider packages/services/Telecomm packages/services/Telephony packages/services/Mms packages/apps/Dialer packages/apps/Phone packages/apps/PhoneCommon packages/apps/BasicSmsReceiver packages/apps/Contacts packages/providers/ContactsProvider frameworks/opt/net/ims frameworks/opt/net/voip packages/apps/Settings packages/apps/Stk packages/apps/Messaging
http://blog.csdn.net/dd864140130/article/details/51718187
编译:
source build/envsetup.sh
lunch
make
启动模拟器:
emulator -gpu on
Kernel下载
参考:https://blog.csdn.net/wukongmingjing/article/details/82116497
git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfish.git kernel_goldfish_android-4.14
cd kernel_goldfish_android-4.14
git checkout android-4.14