Skip to content

Instantly share code, notes, and snippets.

@mutahirqureshi
Created April 10, 2017 18:27
Show Gist options
  • Save mutahirqureshi/d2bf8a77dae388edd390ae3c79bd801d to your computer and use it in GitHub Desktop.
Save mutahirqureshi/d2bf8a77dae388edd390ae3c79bd801d to your computer and use it in GitHub Desktop.
copy local hosts file to Genymotion emulator
#!/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