Skip to content

Instantly share code, notes, and snippets.

@chonamdoo
Forked from drcarter/keep_adb.sh
Created September 30, 2016 03:16
Show Gist options
  • Save chonamdoo/5baf9e5911aa75233a90fb2aa2f76ced to your computer and use it in GitHub Desktop.
Save chonamdoo/5baf9e5911aa75233a90fb2aa2f76ced to your computer and use it in GitHub Desktop.
adb 연결이 끊기는거 방지 script.
#!/bin/bash
function monitor_adb () {
adb start-server
echo "[$(date)] adb started"
while [ "$(adb shell echo 1)" ]; do sleep 5; done
echo "[$(date)] adb is broken, restarting"
adb kill-server
adb start-server || adb start-server
adb reverse tcp:8081 tcp:8081
}
while [ true ]; do time monitor_adb ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment