本文整理汇总了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);
}
示例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);
}
}
示例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
}
示例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();
}
}
}
示例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);
}
示例6: shutdown
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
@Override
public void shutdown() {
for (IChimpDevice device : devices) {
device.dispose();
}
AndroidDebugBridge.terminate();
}
示例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");
}
示例8: disposeDebugBridge
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
*
*/
public void disposeDebugBridge() {
if (debugBridge != null) {
disposeDevices();
AndroidDebugBridge.terminate();
debugBridge = null;
}
}
示例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();
}
示例10: disconnect
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void disconnect() {
if (AndroidDebugBridge.getBridge() != null
&& isAdbInitialized(AndroidDebugBridge.getBridge())) {
AndroidDebugBridge.disconnectBridge();
AndroidDebugBridge.terminate();
}
}
示例11: terminate
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void terminate() {
if (sDebugBridge != null) {
sDebugBridge = null;
AndroidDebugBridge.terminate();
}
}
示例12: terminate
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void terminate() {
if(deviceProvider!=null) {
terminate();
}
AndroidDebugBridge.terminate();
}
示例13: terminate
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/** Disconnects the current {@link AndroidDebugBridge}. */
public static void terminate() {
AndroidDebugBridge.terminate();
}
示例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();
}
示例15: terminate
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public void terminate() {
AndroidDebugBridge.terminate();
}