mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
check if ddms is available before launching debug
This commit is contained in:
@@ -300,7 +300,7 @@ public abstract class AndroidRunConfigurationBase extends ModuleBasedConfigurati
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isDdmsCorrupted(@NotNull AndroidFacet facet) {
|
||||
static boolean isDdmsCorrupted(@NotNull AndroidFacet facet) {
|
||||
AndroidDebugBridge bridge = facet.getDebugBridge();
|
||||
if (bridge != null) {
|
||||
IDevice[] devices = bridge.getDevices();
|
||||
|
||||
@@ -574,6 +574,10 @@ public abstract class AndroidRunningState implements RunProfileState, AndroidDeb
|
||||
myApplicationDeployed = true;
|
||||
}
|
||||
if (!myApplicationLauncher.launch(this, device)) return false;
|
||||
|
||||
if (!checkDdms()) {
|
||||
return false;
|
||||
}
|
||||
synchronized (myDebugLock) {
|
||||
Client client = device.getClient(myTargetPackageName);
|
||||
if (client != null) {
|
||||
@@ -600,6 +604,15 @@ public abstract class AndroidRunningState implements RunProfileState, AndroidDeb
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkDdms() {
|
||||
if (myDebugMode && AndroidRunConfigurationBase.isDdmsCorrupted(myFacet)) {
|
||||
getProcessHandler()
|
||||
.notifyTextAvailable("Debug info is not available. Please close other application using ADB: DDMS, Eclipse\n", STDERR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean uploadAndInstallDependentModules(@NotNull IDevice device) throws IOException {
|
||||
for (AndroidFacet depFacet : myAdditionalFacet2PackageName.keySet()) {
|
||||
String packageName = myAdditionalFacet2PackageName.get(depFacet);
|
||||
|
||||
Reference in New Issue
Block a user