I'm basically trying to simplify my development workflow a bit. I have a azure mobile services project running inside IIS on my windows host machine, which I can connect to from the Genymotion Android VM using an IP address (10.71.34.1).
What I'd like to be able to do is connect to the mobile services website using a host header (e.g. http://devmobservices rather than http://10.71.34.1:12345).
How can I modify the host file opn the Genymotion VM to allow me to do this?
(Also, if there's a better solution then please point me at that!)
Thanks
Matt
A hosts file can be modified to override your network settings and allow your local machine to view a website before the DNS changes propagating.
To modify the host file, you need first to mount the system
partition in read-write.
After launching your Genymotion device, open a command line and type:
adb shell
mount -o remount,rw /system
echo "10.71.34.1 devmobservices" >> /etc/hosts
After that you will be able to reach your service through http://devmobservices:1234
address.
Thanks to the prior commenters for their assistance. Note that the location of adb is different on OS-X, so the actual commands would be:
/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, be sure the VM you want to modify is first running before entering the first command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With