diff options
| author | Xavier Ducrohet <xav@android.com> | 2010-09-27 13:27:22 -0700 |
|---|---|---|
| committer | Xavier Ducrohet <xav@android.com> | 2010-09-27 15:50:36 -0700 |
| commit | 020a428e1dd0231555e5ef855e3e6eca38e59c48 (patch) | |
| tree | bce190abc77f45b599e66e1c0efa2732f1033734 /hierarchyviewer2 | |
| parent | c83ab24062531e9aa2b166596e954375fb53492b (diff) | |
| download | sdk-020a428e1dd0231555e5ef855e3e6eca38e59c48.tar.gz sdk-020a428e1dd0231555e5ef855e3e6eca38e59c48.tar.bz2 sdk-020a428e1dd0231555e5ef855e3e6eca38e59c48.zip | |
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 'hierarchyviewer2')
| -rw-r--r-- | hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java index d1a5b8c7d..b6a1f5849 100644 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java +++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java @@ -47,9 +47,20 @@ public class HierarchyViewerApplicationDirector extends HierarchyViewerDirector @Override public String getAdbLocation() { String hvParentLocation = System.getProperty("com.android.hierarchyviewer.bindir"); //$NON-NLS-1$ + + // 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 hierarchyviewer. if (hvParentLocation != null && hvParentLocation.length() != 0) { + // check if there's a platform-tools folder + File platformTools = new File(new File(hvParentLocation).getParent(), + SdkConstants.FD_PLATFORM_TOOLS); + if (platformTools.isDirectory()) { + return platformTools.getAbsolutePath() + File.separator + SdkConstants.FN_ADB; + } + return hvParentLocation + File.separator + SdkConstants.FN_ADB; } + return SdkConstants.FN_ADB; } |
