Developing a “system app” using Android Studio/AVD emulator

一曲冷凌霜 提交于 2021-02-07 02:57:35

问题


I'm developing an app that requires the android.permission.DUMP permission. This is only permitted for "system" apps (apps signed by the device vendor), or, I'm assuming, apps with root permissions.

How does one develop (and test) an app like that using the AVD emulators? I declare the permission I need, and then build and run the app in the emulator, but when I get to the portion that runs, I run into the same permission error whether I specify the permission in the manifest or not.

How does one develop these types of apps?

I realize that if this was a real device, I would need to root it and/or install a custom ROM. But surely there's a way to tell the emulator to treat my app as if it already was. I keep looking for an "install app as system app" or "run as root" checkbox in the IDE, and I can't find one.


回答1:


Use Genymotion as your emulator. It provides root by default.




回答2:


The normal workflow is build the app as a plain java app project just as you were contributing to the min android OS and create a custom OS image and than execute the emulator using that image and of course you are adjusting that android OS to install as preinstalled your systems app



来源:https://stackoverflow.com/questions/22277813/developing-a-system-app-using-android-studio-avd-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!