本文介绍了开发“系统应用程序".使用Android Studio/AVD模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发需要android.permission.DUMP权限的应用.仅允许系统"应用程序(由设备供应商签名的应用程序)或具有root权限的应用程序使用.

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.

如何使用AVD模拟器开发(和测试)类似的应用程序?我声明了所需的权限,然后在模拟器中构建并运行该应用程序,但是当我进入运行的部分时,无论是否在清单中指定权限,都会遇到相同的权限错误.

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?

我意识到,如果这是一台真正的设备,我将需要将其植根和/或安装一个自定义ROM.但是可以肯定的是,有一种方法可以告诉仿真器将我的应用程序视为已经存在.我一直在IDE中寻找将应用程序安装为系统应用程序"或以root身份运行"复选框,但找不到.

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.

推荐答案

使用 Genymotion 作为模拟器.默认情况下,它提供root用户.

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

这篇关于开发“系统应用程序".使用Android Studio/AVD模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 16:55