I am looking to add a prebuilt APK to AOSP build using the emulator. I successfully installed an APK into system/app directory by doing the related questions.
But I want to add an APK into data/app directory.
My development environments are followings:
- Ubuntu 16.04 LTS
- AOSP: android 6.0.1_r77
- AOSP emulator
I tried the following steps by the several related questions.
- Add the APK to the /packages/apps directory.
- Create an Android.mk file.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := <name of APK>
LOCAL_SRC_FILES := <Name of APK>.apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)
include $(BUILD_PREBUILT)
- Add in /build/target/product/core.mk
PRODUCT_PACKAGES += \ <name of APK>
The above Android.mk file didn't even install the APK into system/app.
And I also tried the followings. The following make files installed the APK into system/app.
...
LOCAL_MODULE_TAGS := tests
...
...
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
...
...
LOCAL_MODULE_PATH := $(TARGET_OUT)/data/app
...
I expect to install the APK into /data/app folder.