简体   繁体   English

在Android模拟器文件系统上编写

[英]Writing on android emulator file system

I am having some trouble interacting with the android emulator. 我在与android模拟器进行交互时遇到了一些麻烦。 My goal is to overwrite the hosts file on the emulated device but I am stuck. 我的目标是覆盖仿真设备上的主机文件,但我被卡住了。

I have used the adb command line tool as suggested in most places. 我在大多数地方都建议使用adb命令行工具。 Symptoms: 症状:

$ adb root
$ adb remount
> Not running as root. Try "adb root" first.

There is no output from the adb root command, and it seems to have no effect. adb root命令没有输出,这似乎没有任何作用。

$ adb shell
emu$ su
emu> su: not found

I have found no way to push files to the device. 我找不到将文件推送到设备的方法。 Not even using the -writable-system when launching the emulator or restarting the adbd server... I have also tried running the script mentioned in this other so answer , but with no success. 在启动仿真器或重新启动adbd服务器时,甚至都没有使用-writable-system ...我也尝试过运行其他提到的脚本, 所以没有成功。

Further information: 更多信息:

  • Host machine OS: Windows 主机操作系统:Windows
  • Android versions on emulator: Android 8.0 and 7.1.1 模拟器上的Android版本:Android 8.0和7.1.1
  • Emulated device: Nexus 5 模拟设备:Nexus 5

I leave this here, in case anybody else encounters the same problem. 万一其他人遇到同样的问题,我就把它留在这里。

After playing around, adb finally works correctly with the emulator. 玩了之后, adb终于可以在模拟器上正常工作了。 My issue was resolved when I changed the emulated device for another model (in my case Nexus 6). 当我将仿真设备更改为其他型号(例如Nexus 6)时,我的问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM