我是mac系统,我在这里记录一下
一、writable-system方式启动模拟器
1 cd ~/Library/Android/sdk/platform-tools //进入目标文件夹
2 emulator -list-avds //列出所有模拟器
3 emulator -avd Nexus_S_API_24_X86 -writable-system //启动你想要修改的模拟器
二、修改hosts文件
1 adb root //root 运行
2 adb remount //挂载文件
3 adb pull /system/etc/hosts ~/Desktop/hosts //将hosts文件放在指定文件夹下(本文中放在桌面)
4 手动在指定文件夹下(本文中放在桌面)打开host文件修改
5 adb push ~/Desktop/hosts /system/etc/hosts //将修改完成的hosts文件放到模拟器中。
6 adb shell cat /etc/hosts //查看host文件是否修改成功
网友评论