I am developing an Android native service. I want to compile and install it only for userdebug builds. How to specify this? Thanks.
Will adding the package to PRODUCT_PACKAGES_DEBUG work?
I am developing an Android native service. I want to compile and install it only for userdebug builds. How to specify this? Thanks.
Will adding the package to PRODUCT_PACKAGES_DEBUG work?
You can use PRODUCT_PACKAGES_DEBUG += some_package, which will include some_package in userdebug and eng builds (reference).
Alternatively, you can add the package directly to PRODUCT_PACKAGES conditionally:
ifeq ($(TARGET_BUILD_VARIANT),userdebug)
PRODUCT_PACKAGES += some_package
endif