网上有一些命令是错的 本人完善了一下 可以运行
1 启动模拟器emulator -avd test 2.2 -partition-size 128, test为模拟器名字 若不指定分区大小的话,在第5六步会提示out of memory的错误。在真机上没有这个问题。
2 切换到root用户:adb root
3 设置系统目录可写:adb remount
4 复制hosts文件到PC上并修改:adb pull /system/etc/hosts
譬如127.0.0.1 host1.example.com
6 将修改后的hosts复制到模拟器:adb push hosts /system/etc/hosts
1 启动模拟器emulator -avd test 2.2 -partition-size 128, test为模拟器名字 若不指定分区大小的话,在第5六步会提示out of memory的错误。在真机上没有这个问题。
2 切换到root用户:adb root
3 设置系统目录可写:adb remount
4 复制hosts文件到PC上并修改:adb pull /system/etc/hosts
譬如127.0.0.1 host1.example.com
6 将修改后的hosts复制到模拟器:adb push hosts /system/etc/hosts