/** * Initialize the Android Debug Bridge and wait for it to start. Does not reinitialize it if it has * already been initialized (that would through and IllegalStateException...). Synchronized sine * the init call in the library is also synchronized .. just in case. */ protected AndroidDebugBridge initAndroidDebugBridge() throws MojoExecutionException { synchronized ( ADB_LOCK ) { if ( ! adbInitialized ) { DdmPreferences.setTimeOut( adbConnectionTimeout ); AndroidDebugBridge.init( false ); adbInitialized = true; } AndroidDebugBridge androidDebugBridge = AndroidDebugBridge .createBridge( getAndroidSdk().getAdbPath(), false ); waitUntilConnected( androidDebugBridge ); return androidDebugBridge; } }
logDebug(debug, "[%s] setDeviceDetails %s", serial, deviceDetails); DdmPreferences.setTimeOut((int) adbTimeout.toMillis());
@Override public void connect() throws AndroidExecutionException { logger.info("Connecting to the Android Debug Bridge at " + adbLocation.getAbsolutePath() + " forceNewBridge = " + forceNewBridge); DdmPreferences.setTimeOut(ddmsTimeOut); AndroidDebugBridge.initIfNeeded(false); this.delegate = AndroidDebugBridge.createBridge(adbLocation.getAbsolutePath(), forceNewBridge); waitUntilConnected(); waitForInitialDeviceList(); }
checkArgument(testApk.exists(), "Could not find test APK: " + testApk); DdmPreferences.setTimeOut((int) adbTimeout.toMillis()); AndroidDebugBridge adb = SpoonUtils.initAdb(androidSdk, adbTimeout);
@Override public void init() throws DeviceException { DdmPreferences.setTimeOut((int) timeOutUnit.toMillis(timeOut)); AndroidDebugBridge.initIfNeeded(false /*clientSupport*/);
@Override public void run() { IDevice deviceInterface = device.getDeviceInterface(); try { DdmPreferences.setTimeOut(30000); installer.prepareInstallation(deviceInterface); // For when previous run crashed/disconnected and left files behind removeRemoteDirectory(deviceInterface); createRemoteDirectory(deviceInterface); createCoverageDirectory(deviceInterface); clearLogcat(deviceInterface); TestCaseEvent testCaseEvent; while ((testCaseEvent = queueOfTestsInPool.poll()) != null) { TestRun testRun = testRunFactory.createTestRun(testCaseEvent, device, pool, progressReporter, queueOfTestsInPool); testRun.execute(); } } finally { logger.info("Device {} from pool {} finished", device.getSerial(), pool.getName()); deviceCountDownLatch.countDown(); } }
try { prepareOutputDirectory(); DdmPreferences.setTimeOut(Defaults.DDMS_TIMEOUT); Device device = deviceLoader.loadDevice(serial); Collection<TestCaseEvent> testCaseEvents = testSuiteLoader.loadTestSuite();