diff options
author | Xavier Ducrohet <xav@android.com> | 2013-03-27 11:31:27 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2013-03-27 11:31:27 -0700 |
commit | 0295fbacaaf3d8eea6638a34f85608d9def51191 (patch) | |
tree | 74ad619e4f207da296fe000c5e6dd4d80b9d9ace /ddms | |
parent | ad784a14ee081d1f12129aa38d0722d77577a683 (diff) | |
download | swt-0295fbacaaf3d8eea6638a34f85608d9def51191.tar.gz |
Update adb location for in Android Source Tree case.
When the tools where built, adb was right next to the tools,
now we look them up with ANDROID_HOST_OUT
Change-Id: Ieea3f021c01cf21daa48dc68bf92e63d9d32d6f2
Diffstat (limited to 'ddms')
-rw-r--r-- | ddms/app/src/main/java/com/android/ddms/UIThread.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ddms/app/src/main/java/com/android/ddms/UIThread.java b/ddms/app/src/main/java/com/android/ddms/UIThread.java index 8aaa806..1310429 100644 --- a/ddms/app/src/main/java/com/android/ddms/UIThread.java +++ b/ddms/app/src/main/java/com/android/ddms/UIThread.java @@ -16,6 +16,7 @@ package com.android.ddms; +import com.android.SdkConstants; import com.android.ddmlib.AndroidDebugBridge; import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.Client; @@ -506,12 +507,20 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { 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$ + adbLocation = platformTools.getAbsolutePath() + File.separator + + SdkConstants.FN_ADB; } else { - adbLocation = ddmsParentLocation + File.separator + "adb"; //$NON-NLS-1$ + // we're in the Android source tree, then adb is in $ANDROID_HOST_OUT/bin/adb + String androidOut = System.getenv("ANDROID_HOST_OUT"); + if (androidOut != null) { + adbLocation = androidOut + File.separator + "bin" + File.separator + + SdkConstants.FN_ADB; + } else { + adbLocation = SdkConstants.FN_ADB; + } } } else { - adbLocation = "adb"; //$NON-NLS-1$ + adbLocation = SdkConstants.FN_ADB; } AndroidDebugBridge.init(true /* debugger support */); |