ADBService extends IntentService { protected AdbConnection connectNetworkADB() throws IOException { AdbConnection connection; try { Socket socket = new Socket("127.0.0.1", 5555); AdbCrypto crypto = setupADBCrypto(); Log.d("ADBService", "Acquiring connection to port :5555"); connection = AdbConnection.create(socket, crypto); Log.d("ADBService", "Trying to connect to ADB session"); connection.connect(); } catch (Exception err) { Log.d("ADBService", "Failed to connect to ADB"); Log.wtf("ADBService", err); throw new IOException("Could not start fakeinputlib"); } Log.d("ADBService", "Got the ADB connection"); return connection; } ADBService(String name);  ADBService(); @Override void onDestroy(); @Override void onCreate(); AdbCrypto setupADBCrypto();  }
@Test(expected = IOException.class) public void connectADB() throws IOException{ service.connectNetworkADB(); }