@@ -184,21 +184,32 @@ public boolean removeApp(String packageName) throws IOException, InterruptedExce
184184
185185 // different version that actually runs through JDI:
186186 // http://asantoso.wordpress.com/2009/09/26/using-jdb-with-adb-to-debugging-of-android-app-on-a-real-device/
187- public boolean launchApp (final String packageName )
187+ public boolean launchApp (final String packageName , boolean isDebuggerEnabled )
188188 throws IOException , InterruptedException {
189189 if (!isAlive ()) {
190190 return false ;
191191 }
192-
193- String [] cmd = {
194- "shell" , "am" , "start" ,
195- "-e" , "debugEnabled" , "true" ,
196- "-a" , "android.intent.action.MAIN" ,
197- "-c" , "android.intent.category.LAUNCHER" , "-D" ,
198- "-n" , packageName + "/.MainActivity"
199- };
192+ ProcessResult pr ;
193+ if (isDebuggerEnabled ){
194+ String [] cmd = {
195+ "shell" , "am" , "start" ,
196+ "-e" , "debugEnabled" , "true" ,
197+ "-a" , "android.intent.action.MAIN" ,
198+ "-c" , "android.intent.category.LAUNCHER" , "-D" ,
199+ "-n" , packageName + "/.MainActivity"
200+ };
201+ pr = adb (cmd );
202+ }else {
203+ String [] cmd = {
204+ "shell" , "am" , "start" ,
205+ "-e" , "debugEnabled" , "true" ,
206+ "-a" , "android.intent.action.MAIN" ,
207+ "-c" , "android.intent.category.LAUNCHER" ,
208+ "-n" , packageName + "/.MainActivity"
209+ };
210+ pr = adb (cmd );
211+ }
200212// PApplet.println(cmd);
201- ProcessResult pr = adb (cmd );
202213
203214 if (Base .DEBUG ) {
204215 System .out .println (pr .toString ());
0 commit comments