aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/app
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-09-27 13:27:22 -0700
committerXavier Ducrohet <xav@android.com>2010-09-27 15:50:36 -0700
commit020a428e1dd0231555e5ef855e3e6eca38e59c48 (patch)
treebce190abc77f45b599e66e1c0efa2732f1033734 /ddms/app
parentc83ab24062531e9aa2b166596e954375fb53492b (diff)
downloadsdk-020a428e1dd0231555e5ef855e3e6eca38e59c48.zip
sdk-020a428e1dd0231555e5ef855e3e6eca38e59c48.tar.gz
sdk-020a428e1dd0231555e5ef855e3e6eca38e59c48.tar.bz2
Make the tools work with the new location of adb.
adb has been moved to the platform-tools folder. This changes ADT, DDMS, HierarchyViewer which all care where adb is (to launch it). Also fixed the local SDK parser of the SDK Updater to find the platform-tools package. Change-Id: I3c869159d7b0e0ad9aaea06f376b7ba3e53bfc7f
Diffstat (limited to 'ddms/app')
-rw-r--r--ddms/app/src/com/android/ddms/UIThread.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java
index 9ba1ea0..d9ea3f1 100644
--- a/ddms/app/src/com/android/ddms/UIThread.java
+++ b/ddms/app/src/com/android/ddms/UIThread.java
@@ -455,9 +455,18 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
ClientData.setMethodProfilingHandler(new MethodProfilingHandler(shell));
// [try to] ensure ADB is running
+ // in the new SDK, adb is in the platform-tools, but when run from the command line
+ // in the Android source tree, then adb is next to ddms.
String adbLocation;
if (ddmsParentLocation != null && ddmsParentLocation.length() != 0) {
- adbLocation = ddmsParentLocation + File.separator + "adb"; //$NON-NLS-1$
+ // check if there's a platform-tools folder
+ File platformTools = new File(new File(ddmsParentLocation).getParent(),
+ "platform-tools"); //$NON-NLS-1$
+ if (platformTools.isDirectory()) {
+ adbLocation = platformTools.getAbsolutePath() + File.separator + "adb"; //$NON-NLS-1$
+ } else {
+ adbLocation = ddmsParentLocation + File.separator + "adb"; //$NON-NLS-1$
+ }
} else {
adbLocation = "adb"; //$NON-NLS-1$
}