Skip to content

Instantly share code, notes, and snippets.

@dotdoom
Last active July 31, 2016 19:34
Show Gist options
  • Select an option

  • Save dotdoom/03586597c00a2ca8312325eb373ed910 to your computer and use it in GitHub Desktop.

Select an option

Save dotdoom/03586597c00a2ca8312325eb373ed910 to your computer and use it in GitHub Desktop.
A "daemon" constantly trying to enable ADB tcpip on any connected device
#!/usr/bin/env bash
led() {
local brightness=0
[ "$1" -eq 0 ] && brightness=1
echo "$brightness" >/sys/class/leds/LED/brightness
}
# Give a chance to connect something else.
sleep 60
/sbin/modprobe -r ledtrig_heartbeat
while :; do
if adb tcpip 5554 &>/dev/null; then
led 1
sleep 10
else
led 0
sleep 2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment