Genymotion: Edit /system/etc/hosts file

会有一股神秘感。 提交于 2019-12-02 21:58:57

Run Genymotion Android emulator and introduce this instructions in the console:

  1. adb root
  2. adb remount
  3. adb push /etc/hosts /system/etc

In the third step, specify your hosts file.

It works for me, I hope also works for you.

I'm using this :

ip="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
adb root
adb remount
cat /etc/hosts|sed 's/127.0.0.1/'$ip'/' > /tmp/hosts-adb
adb push /tmp/hosts-adb /system/etc/hosts

basically this gets your hosts file, change all 127.0.0.1 to your local network ip and send it to genymotion.

Yes, this problem exists and adb root will not solve it on windows, it can't be edited/replaced from eclipse either.

Instead install Total Commander on Genymotion (if you have google apps installed its pretty simple), then go to file you want to edit and long press and select edit with Total Commander Editor. It will ask for root priveleges, grant.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!