AOSP partially build and test on emulator
-
After build AOSP, start emulator with command
emulator -writable-system -
Run
adb remountevery time after emulator restart. -
Now you can use
mmcommand to partially build modules of AOSP and useadb pushto replace jars or apps of framework. -
You should always use
mmto compile
For example, if you modified /frameworks/base/core/res/res/values/dimens.xml, then you can find its nearest make file Android.bp under /frameworks/base/core/res/, then mm here.
After build, you’ll see [100% 8/8] Install: out/target/product/generic_x86/system/framework/framework-res.apk, then push framework-res.apk to emulator path /system/framework/. Restart emulator.
You can do this simply by adb sync. Put the following code into a shell script adbsync. Just run it after mm. Emulator will sync the build outputs and restart.
adb remount
adb sync
adb shell stop
adb shell startReferences
How to mount /system rewritable or read-only? (RW/RO)