开发“系统应用"使用 Android Studio/AVD 模拟器 [英] Developing a "system app" using Android Studio/AVD emulator

查看:43
本文介绍了开发“系统应用"使用 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?

我意识到如果这是一个真实的设备,我需要将它设为 root 和/或安装自定义 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 模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆