@@ -94,16 +94,29 @@ public void setSelectedDevice(Device selectedDevice) {
9494 }
9595
9696 public void killAdbServer () {
97- System .out .println ("Shutting down any existing adb server..." );
97+ System .out .print ("Shutting down any existing adb server..." );
9898 System .out .flush ();
9999 try {
100100 sdk .runADB ("kill-server" );
101+ System .out .println (" Done." );
101102 } catch (final Exception e ) {
102- System .err .println ("Devices .killAdbServer() failed." );
103+ System .err .println ("/nDevices .killAdbServer() failed." );
103104 e .printStackTrace ();
104105 }
105106 }
106107
108+ public void startAdbServer () {
109+ System .out .print ("Starting a new adb server..." );
110+ System .out .flush ();
111+ try {
112+ sdk .runADB ("start-server" );
113+ System .out .println (" Done." );
114+ } catch (final Exception e ) {
115+ System .err .println ("/nDevices.startAdbServer() failed." );
116+ e .printStackTrace ();
117+ }
118+ }
119+
107120 public void enableBluetoothDebugging () {
108121 final Devices devices = Devices .getInstance ();
109122 java .util .List <Device > deviceList = devices .findMultiple (false );
@@ -119,7 +132,8 @@ public void enableBluetoothDebugging() {
119132 try {
120133 // Try Enable debugging over bluetooth
121134 // http://developer.android.com/training/wearables/apps/bt-debugging.html
122- sdk .runADB ("-s" , device .getId (), "forward" , "tcp:" + BT_DEBUG_PORT , "localabstract:/adb-hub" );
135+ sdk .runADB ("-s" , device .getId (), "forward" , "tcp:" + BT_DEBUG_PORT ,
136+ "localabstract:/adb-hub" );
123137 sdk .runADB ("connect" , "127.0.0.1:" + BT_DEBUG_PORT );
124138 } catch (final Exception e ) {
125139 e .printStackTrace ();
0 commit comments