【发布时间】:2019-05-08 18:45:28
【问题描述】:
我正在尝试在模拟器上运行adb root 命令;这是我连接的唯一设备:
$ adb devices
List of devices attached
emulator-5554 device
但是,我收到以下错误消息:
$ adb root
adbd cannot run as root in production builds
我已经尝试按照这个答案adb shell su works but adb root does not 来解决我的问题:
按照设计,adb root 命令仅适用于开发版本(即默认情况下具有 ro.debuggable=1 的 eng 和 userdebug)。或者,您可以使用修改后的 adbd 二进制文件(不检查 ro.debuggable)
但是,我不清楚如何将构建更改为开发构建而不是生产构建?
更新 我发现了一些额外的说明,让我相信要让它工作,你需要让你的模拟器成为一个“可写系统”(参见How to make system partition in AVD in emulator writable)。但是,如果我尝试
$ emulator -avd Nexus_5X_API_28 -writable-system
emulator: WARNING: System image is writable
emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature.
Please use -read-only flag to enable this feature.
我不确定如何解析此错误消息;这是否意味着系统镜像已经是可写的了?
【问题讨论】:
-
你能检查这是否相关:stackoverflow.com/questions/43923996/…