Skip to content

Instantly share code, notes, and snippets.

@staltz
Created October 16, 2017 12:42
Show Gist options
  • Save staltz/a0e5b9de4b2b02970506ec3111265897 to your computer and use it in GitHub Desktop.
Save staltz/a0e5b9de4b2b02970506ec3111265897 to your computer and use it in GitHub Desktop.
Put this in your ~/.bashrc (or equivalent) file. Then run `reactnativedev "192.168.1.101:8081"`
# Tweak tap coordinates as you wish
function reactnativedev() {
adb shell input keyevent 82;
sleep 0.1;
adb shell input tap 150 1401;
sleep 0.1;
adb shell input tap 150 1401;
sleep 0.1;
adb shell input text "$1";
sleep 0.1;
adb shell input tap 800 771;
sleep 0.1;
adb shell input keyevent KEYCODE_BACK;
sleep 0.1;
adb shell input text "RR";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment