How to change host file on Genymotion virtual machine from windows?

I am basically trying to simplify the development process a bit. I have an azure mobile service project running inside IIS on my Windows host machine with which I can connect from the Genymotion Android VM using the IP address (10.71.34.1).

What I would like to do is connect to the mobile services website using the host header (e.g. http: // devmobservices , not http://10.71.34.1:12345 ).

How can I change the host file to a Genymotion virtual machine to allow me to do this?

(Also, if there is a better solution, please tell me that!)

thank

Matt

+4
source share
2 answers

To change the host file, you must first install the partition systemin read-write mode.

After starting your Genymotion device, open a command prompt and enter:

adb shell
mount -o remount,rw /system
echo "10.71.34.1   devmobservices" >> /etc/hosts

After that, you can contact the service through the address http://devmobservices:1234.

+10
source

Thanks to previous commentators for their help. Note that the adb location is different from OS-X, so the actual commands are:

/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS/tools/adb shell

mount -o remount,rw /system

echo "10.71.34.1   devmobservices" >> /etc/hosts

Also, make sure that the virtual machine that you want to change starts first before entering the first command.

+4
source

All Articles