实际操作中发现改MuMu的hosts文件太麻烦了,不如直接让它读PC的hosts文件.通过让PC给MuMu模拟器做代理即可.
步骤如下:
1.安装Charles(https://www.charlesproxy.com/download/).免费版即可.运行Charles,菜单Proxy->Proxy settings的端口确认一下,一般为8888.
2.开启MuMu后,cmd中输入
adb connect 127.0.0.1:7555
连接模拟器.(需要先配好adb调试)
3.cmd中继续输入:
adb -s 127.0.0.1:7555 shell settings put global http_proxy 你的ip:8888
"你的ip"通过cmd输入ipconfig获得.
(如果之后想取消代理,依次输入下面命令:
adb -s 127.0.0.1:7555 shell settings put global http_proxy :0
adb -s 127.0.0.1:7555 shell settings delete global http_proxy)
4.此时再修改C:\Windows\System32\drivers\etc\hosts文件即可让MuMu模拟器也走PC上的hosts配置了.
此外,如果确实想改MuMu的hosts文件的话,想正常写入模拟器的/system/etc/hosts文件,需要注意MuMu模拟器的“设备设置”中,"其他"选择"开启Root权限","磁盘"->"磁盘共享"选"可写系统盘".
之后也是依次输入下列命令(连接,root,推送,查看):
adb connect 127.0.0.1:7555
adb -s 127.0.0.1:7555 root
adb -s 127.0.0.1:7555 push C:\Windows\System32\drivers\etc\hosts /system/etc/hosts
adb -s 127.0.0.1:7555 shell "su 0 cat /system/etc/hosts"

6590

被折叠的 条评论
为什么被折叠?



