Android ソースコード コンパイル ネイティブ エミュレーター
ソースコードのダウンロード
レポをインストールする
ホーム ディレクトリの下に bin/ ディレクトリがあり、パスに含まれていることを確認します。
mkdir ~/bin
PATH=~/bin:$PATH
Repo ツールをダウンロードし、実行可能であることを確認します。
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
ブランチを見る
repo init -u https://android.googlesource.com/platform/manifest
Android サポート ブランチ バージョンのリンクを
初期化
-b
対応するブランチを指定するために使用します。
repo init -u https://android.googlesource.com/platform/manifest -b android-12.1.0_r26
ダウンロード
repo sync
コードのコンパイル
注文
source build/envsetup.sh
lunch $buildType
make -j4
$buildType
の選択
ターミナルで lunch と入力して、サポートされているビルド オプションを確認します
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_blueline_car-userdebug
4. aosp_bonito_car-userdebug
5. aosp_bramble_car-userdebug
6. aosp_car_arm-userdebug
7. aosp_car_arm64-userdebug
8. aosp_car_x86-userdebug
9. aosp_car_x86_64-userdebug
10. aosp_cf_arm64_auto-userdebug
11. aosp_cf_arm64_phone-userdebug
12. aosp_cf_x86_64_foldable-userdebug
13. aosp_cf_x86_64_pc-userdebug
14. aosp_cf_x86_64_phone-userdebug
15. aosp_cf_x86_64_tv-userdebug
16. aosp_cf_x86_auto-userdebug
17. aosp_cf_x86_phone-userdebug
18. aosp_cf_x86_tv-userdebug
19. aosp_coral_car-userdebug
20. aosp_crosshatch_car-userdebug
21. aosp_flame_car-userdebug
22. aosp_redfin_car-userdebug
23. aosp_sargo_car-userdebug
24. aosp_sunfish_car-userdebug
25. aosp_trout_arm64-userdebug
26. aosp_trout_x86-userdebuaosp_car_x86_64-userdebugg
27. aosp_x86-eng
28. aosp_x86_64-eng
29. arm_krait-eng
30. arm_v7_v8-eng
31. armv8-eng
32. armv8_cortex_a55-eng
33. armv8_kryo385-eng
34. beagle_x15-userdebug
35. beagle_x15_auto-userdebug
36. car_x86_64-userdebug
37. db845c-userdebug
38. gsi_car_arm64-userdebug
39. gsi_car_x86_64-userdebug
40. hikey-userdebug
41. hikey64_only-userdebug
42. hikey960-userdebug
43. hikey960_tv-userdebug
44. hikey_tv-userdebug
45. pixel3_mainline-userdebug
46. poplar-eng
47. poplar-user
48. poplar-userdebug
49. qemu_trusty_arm64-userdebug
50. sdk_car_arm-userdebug
51. sdk_car_arm64-userdebug
52. sdk_car_x86-userdebug
53. sdk_car_x86_64-userdebug
54. silvermont-eng
55. uml-userdebug
56. yukawa-userdebug
57. yukawa_sei510-userdebug
このうち、 aosp_car_arm-userdebug
since記述はaosp_car
プラットフォームを示し、arm
プラットフォームのアーキテクチャを示し、userdebug
コンパイルの種類を示します。
コンパイル
make
このコマンドはシステムをコンパイルでき、次のようにモジュールを個別にコンパイルすることもできます。
make systemimage
システム パーティション イメージをコンパイルする
make vendorimage
ベンダー パーティション イメージをコンパイルする
make SystemUI
SystemUI をコンパイルする
make Gallery
アルバムをコンパイルする
make framework
フレームワーク フレームワークをコンパイルする
コンパイルの問題
Android ソース コードのコンパイルの問題を参照してください。
エミュレーターを実行する
注文
emulator
間違い
cannot add library /home/jun/data/AOSP12/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /home/jun/data/AOSP12/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
INTEL-MESA: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0
configAndStartRenderer: setting vsync to 60 hz
qemu-system-x86_64: Could not open '/home/jun/data/AOSP12/out/target/product/generic_car_x86_64/userdata-qemu.img': No such file or directory
見つかりませんuserdata-qemu.img
コンパイルオプションをsdk...
次のように切り替える必要がありますsdk_car_x86_64-userdebug
再実行emulator
参照