android 模拟器 host修改

  1. 点击访问我的网站,查看效果  上海驾校
  2. start your Android Virtual Device (AVD):

    emulator -avd myAvdNameHere -partition-size 256  
    

    This is located in C:\Program Files (x86)\Android\android-sdk-windows\tools\ on Windows 64bit.

    Note: The partition-size parameter is needed to expand the image size to prevent an error in step 5. If you try and perform these steps after starting the emulator from the UI you will receive the following error: failed to copy ‘c:\temp\hosts’ to ‘/system/etc/hosts’: Out of memory

  3. remount the device image as writable:

    adb remount  
    

    This is located in C:\Program Files (x86)\Android\android-sdk-windows\platform-tools\ on Windows 64bit.

  4. save a copy of the existing hosts file to a temporary location on your host computer:

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

  5. edit the hosts file adding an entry pointing to your host computer:

    127.0.0.1     localhost  
    10.0.2.2      mytesthost  
    

  6. save the edited hosts file to your Android emulator:

    adb push c:\temp\hosts /system/etc  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值