@@ -94,16 +94,29 @@ public void setSelectedDevice(Device selectedDevice) {
94
94
}
95
95
96
96
public void killAdbServer () {
97
- System .out .println ("Shutting down any existing adb server..." );
97
+ System .out .print ("Shutting down any existing adb server..." );
98
98
System .out .flush ();
99
99
try {
100
100
sdk .runADB ("kill-server" );
101
+ System .out .println (" Done." );
101
102
} catch (final Exception e ) {
102
- System .err .println ("Devices .killAdbServer() failed." );
103
+ System .err .println ("/nDevices .killAdbServer() failed." );
103
104
e .printStackTrace ();
104
105
}
105
106
}
106
107
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
+
107
120
public void enableBluetoothDebugging () {
108
121
final Devices devices = Devices .getInstance ();
109
122
java .util .List <Device > deviceList = devices .findMultiple (false );
@@ -119,7 +132,8 @@ public void enableBluetoothDebugging() {
119
132
try {
120
133
// Try Enable debugging over bluetooth
121
134
// 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" );
123
137
sdk .runADB ("connect" , "127.0.0.1:" + BT_DEBUG_PORT );
124
138
} catch (final Exception e ) {
125
139
e .printStackTrace ();
0 commit comments