8

I put my application folder in

packages/apps  // inside AOSP source code

Now my application has following Android.mk in the same folder:

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := package_name
LOCAL_CERTIFICATE := platform

include $(BUILD_PACKAGE)

# Use the folloing include to make our test app
include $(call all-makefiles-under,$(LOCAL_PATH))

Now when I build my AOSP project, it also compiles my application and puts the APK file inside:

out/target/product/$MY_PLATFORM/system/app

But I want to put it in:

out/target/product/$MY_PLATFORM/data/app

How do I do this? What make file do I change?

Daniel
  • 2,355
  • 9
  • 23
  • 30
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222

3 Answers3

6

I got the solution by changing this thing in Android.mk

LOCAL_MODULE_TAGS := tests
stkent
  • 19,772
  • 14
  • 85
  • 111
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222
  • this puts the apps in /data/app (by creating a userdata.img partition) but the AOSP's behavior is to not include data partition in the final built image. So do you know a workaround? – Saleh Dec 13 '18 at 19:26
0

Basically, the android AOSP build system doesn't build anything into /data. The idea of the /data partition is that it's user data, and that it will be shipped from the factory empty (and deleted entirely on a device reset). If you want to install something into /data you do it after install using "adb install" or any other mechanism.

What exactly are you trying to accomplish?

Andy Ross
  • 11,699
  • 1
  • 34
  • 31
  • Well, in my case, I want to debug a system app. My plan was to root the device, remove the app from /system/, compile it locally with "mm" and then install it in /data/. This lets me do a compile-install-test cycle without having to rebuild the entire ROM or re-flash the device. – Edward Falk Sep 09 '15 at 23:03
0

You can take help of some other system app. Copy your target app which need to be installed in /data in say /system/usr/share

   device/<your platform> /extras/usr/share/<target app>:system/usr/share/<target app name> \

write above rule in device/platform/<platform specific mk > Now using some other system level app you can check whether your app is installed or not. If not installed install it via package manager by giving above path system/usr/share/<target app name>