How to build a part of Android AOSP?

后端 未结 3 1216
甜味超标
甜味超标 2021-02-01 22:32

I am trying to build my own libs and apps in external directory of the AOSP, but the problem is i have to run make each time and the make will compile/build whole the android.

3条回答
  •  故里飘歌
    2021-02-01 22:53

    To briefly address the more general case, mm is a useful command, but the location from which it should be run is not well documented - or more specifically, it is not always clear what is a "module".

    Let's say you have made a change to SystemUI, which is a specialized app that is key to the overall functionality of Android. This is part of the frameworks/base repository.

    If you just go to the frameworks/base directory, and execute mm it will not find anything to do - your changes will be ignored.

    To actually pick up your changes with mm you have to be in the directory where they reside - in this example, you would need to be in frameworks/base/packages/SystemUI. The appropriate location for other codebases will be different - but as a guess, you probably need to be where the Android.mk covering your changes resides.

    You can then either use the make snod target from the top of the tree to rebuild the system.img and flash it with fastboot, or use adb remount, adb push the new SystemUI.apk, and then adb shell "start; stop" to restart the Android framework.

提交回复
热议问题