Created
April 10, 2017 18:27
-
-
Save mutahirqureshi/d2bf8a77dae388edd390ae3c79bd801d to your computer and use it in GitHub Desktop.
copy local hosts file to Genymotion emulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: ./push_hosts.sh [<genymotion_emulator_serial>] | |
# IP that genymotion assigns to host machine | |
IP="10.0.3.2" | |
[ -z "$1" ] && ADB="adb" || ADB="adb -s $1" | |
cat /etc/hosts | grep '127.0.0.1' | grep -v 'localhost' | sed 's/127.0.0.1/'$IP'/' > /tmp/hosts-adb | |
$ADB root | |
$ADB remount | |
$ADB push /tmp/hosts-adb /system/etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment