Android车机DIY开发之软件篇(十二) AOSP12下载编译
sudo apt-get update
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g+±multilib libc6-dev-i386 lib32ncurses5-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip python-pyelftools python3-pyelftools device-tree-compiler libfdt-dev libfdt1 libssl-dev liblz4-tool python-dev libncurses5 make
sudo rm -rf /usr/bin/python
sudo ln -s /usr/bin/python2 /usr/bin/python
git config --global user.name "赵川"
git config --global user.email"zc1508890767@gmail.com"
sudo apt-get install libqt5x11extras5
mkdir ~/bin
PATH=~/bin:$PATH
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod a+x ~/bin/repo
repo的运行过程中会尝试访问官方的git源更新repo自己,如果想使用tuna的镜像源进行更新,可以将如下内容复制到你的~/.bashrc里
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
cd ...
source ~/.bashrc
cd AOSP12/
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-12.0.0_r13
repo sync
source build/envsetup.sh
lunch
build_build_var_cache
lunch 72
make
emulator -gpu swiftshader_indirect
emulator -gpu off
emulator -wipe-data -gpu swiftshader_indirect
emulator -no-snapshot-load
-
aosp_akita-trunk_staging-userdebug
-
aosp_arm-trunk_staging-eng
-
aosp_arm64-trunk_staging-eng
-
aosp_bluejay-trunk_staging-userdebug
-
aosp_bluejay_car-trunk_staging-userdebug
-
aosp_caiman-trunk_staging-userdebug
-
aosp_cf_arm64_auto-trunk_staging-userdebug
-
aosp_cf_arm64_phone-trunk_staging-userdebug
-
aosp_cf_riscv64_phone-trunk_staging-userdebug
-
aosp_cf_x86_64_auto-trunk_staging-userdebug
-
aosp_cf_x86_64_auto_mdnd-trunk_staging-userdebug
-
aosp_cf_x86_64_foldable-trunk_staging-userdebug
-
aosp_cf_x86_64_only_phone_hsum-trunk_staging-userdebug
-
aosp_cf_x86_64_pc-trunk_staging-userdebug
-
aosp_cf_x86_64_phone-trunk_staging-userdebug
-
aosp_cf_x86_64_tv-trunk_staging-userdebug
-
aosp_cf_x86_tv-trunk_staging-userdebug
-
aosp_cheetah-trunk_staging-userdebug
-
aosp_cheetah_car-trunk_staging-userdebug
-
aosp_cheetah_hwasan-trunk_staging-userdebug
-
aosp_cloudripper-trunk_staging-userdebug
-
aosp_comet-trunk_staging-userdebug
-
aosp_felix-trunk_staging-userdebug
-
aosp_husky-trunk_staging-userdebug
-
aosp_husky_car-trunk_staging-userdebug
-
aosp_komodo-trunk_staging-userdebug
-
aosp_lynx-trunk_staging-userdebug
-
aosp_oriole-trunk_staging-userdebug
-
aosp_oriole_car-trunk_staging-userdebug
-
aosp_panther-trunk_staging-userdebug
-
aosp_panther_car-trunk_staging-userdebug
-
aosp_panther_hwasan-trunk_staging-userdebug
-
aosp_raven-trunk_staging-userdebug
-
aosp_raven_car-trunk_staging-userdebug
-
aosp_ravenclaw-trunk_staging-userdebug
-
aosp_redfin_car-trunk_staging-userdebug
-
aosp_ripcurrent-trunk_staging-userdebug
-
aosp_ripcurrent24-trunk_staging-userdebug
-
aosp_ripcurrentpro-trunk_staging-userdebug
-
aosp_shiba-trunk_staging-userdebug
-
aosp_slider-trunk_staging-userdebug
-
aosp_sunfish_car-trunk_staging-userdebug
-
aosp_tangorpro-trunk_staging-userdebug
-
aosp_tangorpro_car-trunk_staging-userdebug
-
aosp_tokay-trunk_staging-userdebug
-
aosp_trout_arm64-trunk_staging-userdebug
-
aosp_trout_x86_64-trunk_staging-userdebug
-
aosp_whitefin-trunk_staging-userdebug
-
aosp_x86-trunk_staging-eng
-
aosp_x86_64-trunk_staging-eng
-
arm_krait-trunk_staging-eng
-
arm_v7_v8-trunk_staging-eng
-
armv8-trunk_staging-eng
-
armv8_cortex_a55-trunk_staging-eng
-
armv8_kryo385-trunk_staging-eng
-
db845c-trunk_staging-userdebug
-
gsi_car_arm64-trunk_staging-userdebug
-
gsi_car_x86_64-trunk_staging-userdebug
-
hikey-trunk_staging-userdebug
-
hikey64_only-trunk_staging-userdebug
-
hikey960-trunk_staging-userdebug
-
hikey960_tv-trunk_staging-userdebug
-
hikey_tv-trunk_staging-userdebug
-
poplar-trunk_staging-eng
-
poplar-trunk_staging-user
-
poplar-trunk_staging-userdebug
-
qemu_trusty_arm64-trunk_staging-userdebug
-
riscv64-trunk_staging-eng
-
sdk_car_arm64-trunk_staging-userdebug
-
sdk_car_cw_x86_64-trunk_staging-userdebug
-
sdk_car_md_x86_64-trunk_staging-userdebug
-
sdk_car_x86_64-trunk_staging-userdebug
-
silvermont-trunk_staging-eng
-
yukawa-trunk_staging-userdebug
Android Studio for Platform 使用方法
sudo dpkg -i XXXX.deb
cd /opt/android-studio-for-platform/bin
./studio.sh
Repo checkout,选择你的AOSP源码根目录。
Lunch target,选择你的lunch目标,比如模拟器的话就填写sdk_phone_x86_64。
Module Path,选择你要调试的模块,比如调试frameworks模块的话,就添加选择frameworks。
Project name,填写你的项目名。
Location,这是你的Android Studio For Platform存储项目信息的路径。
点击右上角的Attach Debugger To Android Process
ADB 使用方法
export PATH=~/Android/Sdk/platform-tools:$PATH
如果需要移植生效写入~/.bashrc 然后 source ~/.bashrc
adb devices
adb shell