• After build AOSP, start emulator with command emulator -writable-system

  • Run adb remount every time after emulator restart.

  • Now you can use mm command to partially build modules of AOSP and use adb push to replace jars or apps of framework.

  • You should always use mm to 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 start

References

How to mount /system rewritable or read-only? (RW/RO)

AOSP Part 1: Get the code using the Manifest and Repo tool

AOSP Part 2: Build variants

AOSP Part 3: Developing Efficiently