`
sunday132
  • 浏览: 50463 次
  • 性别: Icon_minigender_1
  • 来自: 南京
文章分类
社区版块
存档分类
最新评论

更改Android模拟器中的hosts文件(转)

阅读更多

下载 android 模拟器后解压得到 android-sdk-linux_x86 文件夹

进入到android-sdk-linux_x86/tools/


取出hosts文件到PC上
./adb root
./adb remount
获得root权限并将虚拟手机上的/system重新挂载为可写


./adb push /home/jecelyin/hosts /system/etc/hosts

执行 ./android 创建一个test的虚拟手机

 

启动虚拟手机并更改分区大小为128M

./emulator -avd test -partition-size 128

 

新打开一个终端在当前目录执行

./adb pull /system/etc/hosts /home/jecelyin/

然后执行

在电脑上修改/home/jecelyin/hosts文件,如果需要虚拟手机访问电脑上的web网站,hosts的ip地址应该为10.0.2.2

 

执行下面命令传回

./adb push /home/jecelyin/hosts /system/etc/hosts


重启模拟器

 

转自:http://blog.csdn.net/homebei2/article/details/6045961

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics