Ubuntu: adbd start/stop script

$ sudo nano /etc/init.d/adbd

#! /bin/sh
### BEGIN INIT INFO
# Provides: adbd
# Required-Start: $local_fs $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: adb daemon
### END INIT INFO
# path to your platform-tools directory
PATH=/sbin:/bin:/android/sdk/platform-tools/

. /lib/lsb/init-functions

case “$1″ in
start)
adb start-server
;;
restart|reload|force-reload)
echo “Error: argument ‘$1′ not supported” >&2
exit 3
;;
*)
echo “Usage: $0 start|stop” >&2
exit 3
;;
esac 

Save it! CTRL+O. CTRL+X
$ sudo chmod +x /etc/init.d/adbd
$ sudo update-rc.d adbd defaults

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*