Download Android Source Code and Build
Basic Infomation
Installing OpenJDK
|
|
Installing Required Packages
|
|
Installing Android Platform Tools
|
|
Init Git Information
|
|
Installing Repo
|
|
Initializing a Repo client
|
|
- repo init參數說明:
- -u https://android.googlesource.com/platform/manifest: 固定寫法
- -b android-7.1.2_r33: 可以查看source-code-tags-and-builds 中目標Device所支持的Android branch來進行選擇
- –depth=1 代表建立深度爲1的shallow clone,這樣就不用下載大量的Git歷史訊息,可以大大減少下載的量,並且對實際開發已經足夠使用
Downloading the Android Source Tree
|
|
Installing Device Driver
- 根據source-code-tags-and-builds 查看目標Device與Android branch對應的Build,然後到drivers下載Build對應的Driver
- 例如目標Device是Pixel,而Android Branch爲android-7.1.2_r33,則對應的Build爲NZH54D,所以到drivers中找到Pixel binaries for Android 7.1.2 (NZH54D),並下載當中的2個Driver
- 下載完後將Driver解壓縮,並進行安裝
|
|
Buiding Android Source
- lunch 後選擇目標Device的代號,Device code name 可以參考selecting-device-build
- 例如Pxiel的Code name 爲sailfish,所以選擇18.aosp_sailfish-userdebug
- 若之後修改了Android source code,要進行重新編譯,則進行此步驟即可
|
|
Referance
Google Android Developers: