0

I'm trying to edit the hosts file on the Marshmallow emulator, but I can't do it. I use ADB tool:

  1. I start emulator using emulator.exe

  2. adb mount

  3. adb pull /system/etc/hosts c:\temp

  4. Then I edit hosts file

  5. ADB push c:\temp\hosts /system/etc (this step doesn't work, because I get error - "read-only file system").

Also, I tried to do adb shell and then SU commands and then mount -o rw,remount /system. But every time when I try to edit hosts file, I get the error that file system is read only.

Any ideas?

4

2 に答える 2

0

再マウントのためにこれを試してください:

    adb shell
    setenforce 0 
    mount -o rw,remount /system 
    setenforce 1
于 2016-07-20T11:14:30.260 に答える
0

これらの手順は私にとってはうまくいきます(Windows 8.1およびAndroid Studioエミュレーター(qemu))

  1. コマンドプロンプトを開く
  2. cd %localappdata%\Android\sdk\tools
  3. -writable-system フラグを使用して、コマンド ラインからエミュレータを実行します。 emulator -avd (your AVD name) -writable-system

エミュレーターの起動中 (Android スプラッシュが表示されるまで待ちます):

  1. cd %localappdata%\Android\sdk\platform-tools
  2. adb root(このコマンドが成功するまで先に進まないでください)
  3. adb remount
  4. adb push c:\temp\hosts /system/etc/hosts
于 2016-08-17T15:59:38.993 に答える