当前位置: 首页>>代码示例>>Java>>正文


Java AndroidDebugBridge.terminate方法代码示例

本文整理汇总了Java中com.android.ddmlib.AndroidDebugBridge.terminate方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidDebugBridge.terminate方法的具体用法?Java AndroidDebugBridge.terminate怎么用?Java AndroidDebugBridge.terminate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.ddmlib.AndroidDebugBridge的用法示例。


在下文中一共展示了AndroidDebugBridge.terminate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void main(String[] args) {		
	Timer timer = new Timer();
       timer.schedule(new TimerTask() {        	
           @Override
           public void run() {
           	LoggerHelper.logEvent(MyLevel.TIMEOUT, "-1 | Complete analysis stopped due to timeout of 40 minutes");
               System.exit(0);
           }
       }, 40 * 60000);
	
	
	try{
		Main.v().run(args);
		AndroidDebugBridge.terminate();
	}catch(Exception ex) {
		StringWriter sw = new StringWriter();
		PrintWriter pw = new PrintWriter(sw);
		ex.printStackTrace(pw);			
		LoggerHelper.logEvent(MyLevel.EXCEPTION_ANALYSIS, sw.toString());
		UtilMain.writeToFile("mainException.txt", FrameworkOptions.apkPath + "\n");
	}
	LoggerHelper.logEvent(MyLevel.EXECUTION_STOP, "Analysis successfully terminated");
	//this is necessary otherwise we will wait for a max of 20 minutes for the TimerTask
	System.exit(0);
}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:26,代码来源:Main.java

示例2: close

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * Closes all open resources. <b>MUST BE CALLED WHEN THIS CLASS IS NO LONGER NEEDED.</b>
 */
public void close() {
    LOGGER.info("Closing the AgentManager.");
    try {
        // We close the bridge and adb service, so bridge creation wont fail next time we try. This is a workaround,
        // ddmlib is bugged.
        AndroidDebugBridge.disconnectBridge();

        // Terminate the bridge connection
        AndroidDebugBridge.terminate();

        dispatcher.close();

        // Stops the chrome driver started as a service
        deviceManager.stopChromeDriverService();

        if(AgentPropertiesLoader.hasFtpServer()) {
            // Disconnect and logout the FTP client
            deviceManager.stopFtpFileTransferService();
        }
    } catch (Exception e) {
        // If something cannot be closed it was never opened, so it's okay.
        // Nothing to do here.
        LOGGER.info(e);
    }
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:29,代码来源:AgentManager.java

示例3: shutdown

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * Shutdown the AndroidDebugBridge and clean up all connected devices.
 */
public void shutdown() {
  log.info("Notifying device listener about shutdown");
  for (HardwareDeviceListener listener : deviceListeners) {
    for (AndroidDevice device : connectedDevices.values()) {
      listener.onDeviceDisconnected(connectedDevices.get(device));
    }
  }
  log.info("Removing Device Manager listener from ADB");
  AndroidDebugBridge.removeDeviceChangeListener(this);
  if (!shouldKeepAdbAlive) {
    AndroidDebugBridge.disconnectBridge();
  }
  AndroidDebugBridge.terminate();
  log.info("stopping Device Manager");
  // TODO add thread interrupt and join handling
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:20,代码来源:DefaultDeviceManager.java

示例4: waitForDevice

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
private void waitForDevice() {
	long start = System.currentTimeMillis();
	while (adb.hasInitialDeviceList() == false) {
		long timeLeft = start + ADB_CONNECT_TIMEOUT_MS - System.currentTimeMillis();
		
		if (timeLeft <= 0) {
			break;
		}
		
		try{
			Thread.sleep(ADB_CONNECT_TIME_STEP_MS);
		}catch(Exception ex) {
			LoggerHelper.logEvent(MyLevel.EXCEPTION_ANALYSIS, ex.getMessage());
			ex.printStackTrace();
		}
	}
	
	if(!adb.hasInitialDeviceList()) {
		LoggerHelper.logEvent(MyLevel.EXCEPTION_RUNTIME, "NOT POSSIBLE TO CONNECT TO ADB -- giving up and close program!");
		System.exit(-1);
	}
	
	int count = 0;		
	while (adb.getDevices().length == 0) {
		try {
			Thread.sleep(5000);
			LoggerHelper.logEvent(MyLevel.RUNTIME, "not possible to find a device...");
			count++;
		} catch (InterruptedException e) {
			LoggerHelper.logEvent(MyLevel.EXCEPTION_ANALYSIS, e.getMessage());
			e.printStackTrace();
			AndroidDebugBridge.terminate();
		}
		if (count > 50) {
			LoggerHelper
					.logEvent(MyLevel.RUNTIME, "After 100 seconds not able to find an Android device. Shutting down...");
			AndroidDebugBridge.terminate();				
		}
	}
}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:41,代码来源:FrameworkEventManager.java

示例5: printAndExit

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
private static void printAndExit(String message, boolean terminate) {
    System.out.println(message);
    if (terminate) {
        AndroidDebugBridge.terminate();
    }
    System.exit(1);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:Screenshot.java

示例6: shutdown

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
@Override
public void shutdown() {
    for (IChimpDevice device : devices) {
        device.dispose();
    }
    AndroidDebugBridge.terminate();
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:8,代码来源:AdbBackend.java

示例7: shutdown

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * Shutdown the AndroidDebugBridge and clean up all connected devices.
 */
@Override
public void shutdown() {
  if (!shouldKeepAdbAlive) {
    AndroidDebugBridge.disconnectBridge();
    AndroidDebugBridge.terminate();
  }
  logger.info("stopping Device Manager");
}
 
开发者ID:cosysoft,项目名称:device,代码行数:12,代码来源:AndroidDeviceStore.java

示例8: disposeDebugBridge

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * 
 */
public void disposeDebugBridge() {
	if (debugBridge != null) {
		disposeDevices();
		AndroidDebugBridge.terminate();
		debugBridge = null;
	}
}
 
开发者ID:IPEldorado,项目名称:RemoteResources,代码行数:11,代码来源:ServerConnectionManager.java

示例9: disconnect

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * Shutdown the AndroidDebugBridge and clean up all connected devices.
 */
public void disconnect() {
	
	Iterator<TestDevice> iterator = devices.iterator();
	
	while (iterator.hasNext()) {
		
		TestDevice device = iterator.next();
		device.dispose();
	}

	AndroidDebugBridge.removeDeviceChangeListener(this);
	AndroidDebugBridge.terminate();
}
 
开发者ID:eBay,项目名称:mtdtool,代码行数:17,代码来源:TestDeviceManager.java

示例10: disconnect

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void disconnect() {
  if (AndroidDebugBridge.getBridge() != null
      && isAdbInitialized(AndroidDebugBridge.getBridge())) {
    AndroidDebugBridge.disconnectBridge();
    AndroidDebugBridge.terminate();
  }
}
 
开发者ID:facebook,项目名称:buck,代码行数:8,代码来源:AndroidDebugger.java

示例11: terminate

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void terminate() {
  if (sDebugBridge != null) {
    sDebugBridge = null;
    AndroidDebugBridge.terminate();
  }
}
 
开发者ID:DroidTesting,项目名称:android-uiautomatorviewer,代码行数:7,代码来源:DebugBridge.java

示例12: terminate

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void terminate() {
    if(deviceProvider!=null) {
        terminate();
    }
    AndroidDebugBridge.terminate();
}
 
开发者ID:apptik,项目名称:tarator,代码行数:7,代码来源:Nuts.java

示例13: terminate

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/** Disconnects the current {@link AndroidDebugBridge}. */
public static void terminate() {
    AndroidDebugBridge.terminate();
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:5,代码来源:DeviceBridge.java

示例14: shutdownForcely

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * used with caution or don't call this method
 */
@Override
public void shutdownForcely() {
  AndroidDebugBridge.disconnectBridge();
  AndroidDebugBridge.terminate();
}
 
开发者ID:cosysoft,项目名称:device,代码行数:9,代码来源:AndroidDeviceStore.java

示例15: terminate

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public void terminate() {
	AndroidDebugBridge.terminate();
}
 
开发者ID:adakoda,项目名称:android-screen-monitor,代码行数:4,代码来源:ADB.java


注:本文中的com.android.ddmlib.AndroidDebugBridge.terminate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。