本文整理汇总了Java中com.android.ddmlib.DdmPreferences类的典型用法代码示例。如果您正苦于以下问题:Java DdmPreferences类的具体用法?Java DdmPreferences怎么用?Java DdmPreferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DdmPreferences类属于com.android.ddmlib包,在下文中一共展示了DdmPreferences类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initAndroidDebugBridge
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
protected static AndroidDebugBridge initAndroidDebugBridge(AndroidBuilder androidBuilder) {
synchronized (ADB_LOCK) {
if (!adbInitialized) {
DdmPreferences.setTimeOut(adbConnectionTimeout);
AndroidDebugBridge.init(false);
adbInitialized = true;
}
AndroidDebugBridge androidDebugBridge = AndroidDebugBridge.createBridge(
androidBuilder.getSdkInfo().getAdb().getAbsolutePath(), false);
waitUntilConnected(androidDebugBridge);
return androidDebugBridge;
}
}
开发者ID:alibaba,项目名称:atlas,代码行数:14,代码来源:AwoInstaller.java
示例2: setUp
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws Exception {
DdmPreferences.setLogLevel("warn");
Log.setLogOutput(new DdmLibLogListener(Level.ALL, false /* do no log to a file */));
String pathToAdb = AgentPropertiesLoader.getAdbPath();
AndroidDebugBridgeManager androidDebugBridgeManager = new AndroidDebugBridgeManager();
androidDebugBridgeManager.setAndroidDebugBridgePath(pathToAdb);
androidDebugBridgeManager.startAndroidDebugBridge();
fileRecycler = mock(FileRecycler.class);
agentManager = new AgentManager(fileRecycler);
deviceManager = new DeviceManager(fileRecycler);
}
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:16,代码来源:AgentManagerTest.java
示例3: initAndroidDevices
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
/**
* call once
*/
public void initAndroidDevices(boolean shouldKeepAdbAlive)
throws AndroidDeviceException {
// DdmPreferences.setLogLevel(LogLevel.VERBOSE.getStringValue());
DdmPreferences.setInitialThreadUpdate(true);
DdmPreferences.setInitialHeapUpdate(true);
this.initializeAdbConnection();
}
开发者ID:cosysoft,项目名称:device,代码行数:11,代码来源:AndroidDeviceStore.java
示例4: createAdb
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
/**
* Creates connection to adb and waits for this connection to be initialized and receive initial
* list of devices.
*/
@Nullable
@SuppressWarnings("PMD.EmptyCatchBlock")
private static AndroidDebugBridge createAdb(
AndroidPlatformTarget androidPlatformTarget, ExecutionContext context)
throws InterruptedException {
DdmPreferences.setTimeOut(60000);
try {
AndroidDebugBridge.init(/* clientSupport */ false);
} catch (IllegalStateException ex) {
// ADB was already initialized, we're fine, so just ignore.
}
AndroidDebugBridge adb =
AndroidDebugBridge.createBridge(androidPlatformTarget.getAdbExecutable().toString(), false);
if (adb == null) {
context
.getConsole()
.printBuildFailure("Failed to connect to adb. Make sure adb server is running.");
return null;
}
long start = System.currentTimeMillis();
while (!isAdbInitialized(adb)) {
long timeLeft = start + ADB_CONNECT_TIMEOUT_MS - System.currentTimeMillis();
if (timeLeft <= 0) {
break;
}
Thread.sleep(ADB_CONNECT_TIME_STEP_MS);
}
return isAdbInitialized(adb) ? adb : null;
}
开发者ID:facebook,项目名称:buck,代码行数:37,代码来源:AdbHelper.java
示例5: getColumnText
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
@Override
public String getColumnText(Object element, int columnIndex) {
if (element instanceof IDevice) {
IDevice device = (IDevice)element;
switch (columnIndex) {
case DEVICE_COL_SERIAL:
return device.getName();
case DEVICE_COL_STATE:
return getStateString(device);
case DEVICE_COL_BUILD: {
String version = device.getProperty(IDevice.PROP_BUILD_VERSION);
if (version != null) {
String debuggable = device.getProperty(IDevice.PROP_DEBUGGABLE);
if (device.isEmulator()) {
String avdName = device.getAvdName();
if (avdName == null) {
avdName = "?"; // the device is probably not online yet, so
// we don't know its AVD name just yet.
}
if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
return String.format("%1$s [%2$s, debug]", avdName,
version);
} else {
return String.format("%1$s [%2$s]", avdName, version); //$NON-NLS-1$
}
} else {
if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
return String.format("%1$s, debug", version);
} else {
return String.format("%1$s", version); //$NON-NLS-1$
}
}
} else {
return "unknown";
}
}
}
} else if (element instanceof Client) {
Client client = (Client)element;
ClientData cd = client.getClientData();
switch (columnIndex) {
case CLIENT_COL_NAME:
String name = cd.getClientDescription();
if (name != null) {
return name;
}
return "?";
case CLIENT_COL_PID:
return Integer.toString(cd.getPid());
case CLIENT_COL_PORT:
if (mAdvancedPortSupport) {
int port = client.getDebuggerListenPort();
String portString = "?";
if (port != 0) {
portString = Integer.toString(port);
}
if (client.isSelectedClient()) {
return String.format("%1$s / %2$d", portString, //$NON-NLS-1$
DdmPreferences.getSelectedDebugPort());
}
return portString;
}
}
}
return null;
}
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:69,代码来源:DevicePanel.java
示例6: getColumnText
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
@Override
public String getColumnText(Object element, int columnIndex) {
if (element instanceof IDevice) {
IDevice device = (IDevice)element;
switch (columnIndex) {
case DEVICE_COL_SERIAL:
return getDeviceName(device);
case DEVICE_COL_STATE:
return getStateString(device);
case DEVICE_COL_BUILD: {
String version = device.getProperty(IDevice.PROP_BUILD_VERSION);
if (version != null) {
String debuggable = device.getProperty(IDevice.PROP_DEBUGGABLE);
if (device.isEmulator()) {
String avdName = device.getAvdName();
if (avdName == null) {
avdName = "?"; // the device is probably not online yet, so
// we don't know its AVD name just yet.
}
if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
return String.format("%1$s [%2$s, debug]", avdName,
version);
} else {
return String.format("%1$s [%2$s]", avdName, version); //$NON-NLS-1$
}
} else {
if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
return String.format("%1$s, debug", version);
} else {
return String.format("%1$s", version); //$NON-NLS-1$
}
}
} else {
return "unknown";
}
}
}
} else if (element instanceof Client) {
Client client = (Client)element;
ClientData cd = client.getClientData();
switch (columnIndex) {
case CLIENT_COL_NAME:
String name = cd.getClientDescription();
if (name != null) {
return name;
}
return "?";
case CLIENT_COL_PID:
return Integer.toString(cd.getPid());
case CLIENT_COL_PORT:
if (mAdvancedPortSupport) {
int port = client.getDebuggerListenPort();
String portString = "?";
if (port != 0) {
portString = Integer.toString(port);
}
if (client.isSelectedClient()) {
return String.format("%1$s / %2$d", portString, //$NON-NLS-1$
DdmPreferences.getSelectedDebugPort());
}
return portString;
}
}
}
return null;
}
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:69,代码来源:DevicePanel.java
示例7: executeShellCommand
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
@Override
public String executeShellCommand(String command) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
return executeShellCommand(command, DdmPreferences.getTimeOut());
}
开发者ID:oliver32767,项目名称:MonkeyBoard,代码行数:5,代码来源:DeviceController.java
示例8: FileListingService
import com.android.ddmlib.DdmPreferences; //导入依赖的package包/类
/**
* Creates a File Listing Service for a specified {@link Device}.
*
* @param device
* The Device the service is connected to.
*/
FileListingService(IDevice device) {
mDevice = device;
DdmPreferences.setLogLevel(mLogLevel);
}
开发者ID:lrscp,项目名称:AndroidFileExplorer,代码行数:11,代码来源:FileListingService.java
注:本文中的com.android.ddmlib.DdmPreferences类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论