I need to add some 3rd party APKs to my AOSP build. What folder should I keep these APKs so that when I build the code and the image is created, it is installed in the emulator?
It looks like the system apps are kept in the packages/app folder so I need to know where the third party APKs are kept.
Adding third party APKs to the build is definitely possible.
Also APKs and APPs with source code go to the same place; the
package/app
folder.Adding a new APK to the build
In the AOSP root add the folder:
<aosp root>/package/app/< yourappfolder >
Then inside this folder add:
Android.mk
< yourapp.apk >
The android make file should have the reference to your apk, add this to your
Android.mk
:Create an entry in the
commons.mk
(usually inbuild/target/product
) for your apk add the line (check where all the others are)Compile the AOSP and you have a brand new app installed on the system.
You could also do the following in the target output dir:
At this point you can make whatever changes you'd like to the files in system_root, i.e. adding apks to system/app etc...
When you're done just go back down to the output dir and do:
You can now flash system.img using fastboot as usual.
The Android.mk presented above will install the APK in /system/app
If you wish to install the APK in /data/app you will need to add the following the line to Android.mk before line
include $(BUILD_PREBUILT)