@Test(expected = IOException.class) public void spawnApp() throws Exception{ service.spawnApp(null, "Yolo"); }
protected void spawnApp(AdbConnection connection, String command) throws Exception { if (connection == null) { throw new IOException("Connection is null"); } Log.d("AppDaemon", "Spawning the app"); try { AdbStream stream = connection.open(command); new Thread(() -> { try { for (; ; ) { Log.d("AppDaemon", "Read loop"); stream.read(); } } catch (Exception e) { Log.d("AppDaemon", "Failed the read loop"); e.printStackTrace(); } Log.d("AppDaemon", "Stopping the App"); }).start(); } catch (Exception e) { Log.d("AppDaemon", "Failed to satart listener", e); throw e; } }
ADBService extends IntentService { protected void spawnApp(AdbConnection connection, String command) throws Exception { if (connection == null) { throw new IOException("Connection is null"); } Log.d("AppDaemon", "Spawning the app"); try { AdbStream stream = connection.open(command); new Thread(() -> { try { for (; ; ) { Log.d("AppDaemon", "Read loop"); stream.read(); } } catch (Exception e) { Log.d("AppDaemon", "Failed the read loop"); e.printStackTrace(); } Log.d("AppDaemon", "Stopping the App"); }).start(); } catch (Exception e) { Log.d("AppDaemon", "Failed to satart listener", e); throw e; } } }
ADBService extends IntentService { protected void spawnApp(AdbConnection connection, String command) throws Exception { if (connection == null) { throw new IOException("Connection is null"); } Log.d("AppDaemon", "Spawning the app"); try { AdbStream stream = connection.open(command); new Thread(() -> { try { for (; ; ) { Log.d("AppDaemon", "Read loop"); stream.read(); } } catch (Exception e) { Log.d("AppDaemon", "Failed the read loop"); e.printStackTrace(); } Log.d("AppDaemon", "Stopping the App"); }).start(); } catch (Exception e) { Log.d("AppDaemon", "Failed to satart listener", e); throw e; } } ADBService(String name);  ADBService(); }
ADBService extends IntentService { protected void spawnApp(AdbConnection connection, String command) throws Exception { if (connection == null) { throw new IOException("Connection is null"); } Log.d("AppDaemon", "Spawning the app"); try { AdbStream stream = connection.open(command); new Thread(() -> { try { for (; ; ) { Log.d("AppDaemon", "Read loop"); stream.read(); } } catch (Exception e) { Log.d("AppDaemon", "Failed the read loop"); e.printStackTrace(); } Log.d("AppDaemon", "Stopping the App"); }).start(); } catch (Exception e) { Log.d("AppDaemon", "Failed to satart listener", e); throw e; } } ADBService(String name);  ADBService(); @Override void onDestroy(); @Override void onCreate(); AdbCrypto setupADBCrypto(); }
ADBService extends IntentService { protected void spawnApp(AdbConnection connection, String command) throws Exception { if (connection == null) { throw new IOException("Connection is null"); } Log.d("AppDaemon", "Spawning the app"); try { AdbStream stream = connection.open(command); new Thread(() -> { try { for (; ; ) { Log.d("AppDaemon", "Read loop"); stream.read(); } } catch (Exception e) { Log.d("AppDaemon", "Failed the read loop"); e.printStackTrace(); } Log.d("AppDaemon", "Stopping the App"); }).start(); } catch (Exception e) { Log.d("AppDaemon", "Failed to satart listener", e); throw e; } } ADBService(String name);  ADBService(); @Override void onDestroy(); @Override void onCreate(); AdbCrypto setupADBCrypto();  }