30
30
import java .util .regex .Pattern ;
31
31
32
32
import processing .app .ui .Editor ;
33
+ import processing .app .Messages ;
33
34
import processing .app .RunnerListener ;
34
35
import processing .app .SketchException ;
35
36
import processing .mode .java .runner .Runner ;
@@ -98,7 +99,18 @@ public void launch(Future<Device> deviceFuture, boolean wear) {
98
99
listener .statusNotice ("Installing sketch on " + device .getId ());
99
100
// this stopped working with Android SDK tools revision 17
100
101
if (!device .installApp (build , listener )) {
101
- listener .statusError ("Lost connection with device while installing. Try again." );
102
+ if (device .getId ().contains ("emulator" )) {
103
+ // More detailed message when using the emulator, to following discussion in
104
+ // https://code.google.com/p/android/issues/detail?id=104305
105
+ listener .statusError ("Lost connection with emulator while installing. Try again." );
106
+ Messages .showWarning ("The emulator is slooow..." ,
107
+ "This is common when the emulator is booting up for the first time.\n " +
108
+ "Just try again once the emulator is ready, or set the\n " +
109
+ "ADB_INSTALL_TIMEOUT environmental variable to have a.\n " +
110
+ "longer timeout, for example 5 minutes or more" );
111
+ } else {
112
+ listener .statusError ("Lost connection with device while installing. Try again." );
113
+ }
102
114
Devices .killAdbServer (); // see above
103
115
return ;
104
116
}
@@ -111,8 +123,8 @@ public void launch(Future<Device> deviceFuture, boolean wear) {
111
123
// monitor.setNote("Starting sketch on " + device.getId());
112
124
listener .statusNotice ("Starting sketch on " + device .getId ());
113
125
if (startSketch (build , device )) {
114
- listener .statusNotice ("Sketch launched on the "
115
- + (device .isEmulator () ? "emulator" : "device" ) + "." );
126
+ listener .statusNotice ("Sketch launched "
127
+ + (device .isEmulator () ? "in the emulator" : "on the device" ) + "." );
116
128
} else {
117
129
listener .statusError ("Could not start the sketch." );
118
130
}
0 commit comments