aboutsummaryrefslogtreecommitdiffstats
path: root/chimpchat
diff options
context:
space:
mode:
authorBill Napier <napier@google.com>2011-08-22 10:21:52 -0700
committerBill Napier <napier@google.com>2011-08-22 10:21:52 -0700
commit4d41c73734de2c47b89bbe3d4fd182be785d7145 (patch)
tree020f4c7d200fa31d84fa8ae3d3e1b379f9eb640d /chimpchat
parent15e9f6bbf0819aae5248337b313492b5cf6241ae (diff)
downloadsdk-4d41c73734de2c47b89bbe3d4fd182be785d7145.zip
sdk-4d41c73734de2c47b89bbe3d4fd182be785d7145.tar.gz
sdk-4d41c73734de2c47b89bbe3d4fd182be785d7145.tar.bz2
Change how to find adb.
This method is aligned with how hierarchyviewer2 finds adb. Change-Id: I56a5a12e3e6ff592748a3afee18299d16066a537
Diffstat (limited to 'chimpchat')
-rw-r--r--chimpchat/src/com/android/chimpchat/adb/AdbBackend.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java b/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java
index 9354737..68e17dc 100644
--- a/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java
+++ b/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java
@@ -17,10 +17,10 @@ package com.android.chimpchat.adb;
import com.google.common.collect.Lists;
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.IDevice;
import com.android.chimpchat.core.IChimpBackend;
import com.android.chimpchat.core.IChimpDevice;
+import com.android.ddmlib.AndroidDebugBridge;
+import com.android.ddmlib.IDevice;
import com.android.sdklib.SdkConstants;
import java.io.File;
@@ -56,9 +56,9 @@ public class AdbBackend implements IChimpBackend {
}
private String findAdb() {
- File location =
- new File(AdbBackend.class.getProtectionDomain().getCodeSource().getLocation().getPath());
- String mrParentLocation = new File(location.getParent()).getParent();
+ String mrParentLocation =
+ System.getProperty("com.android.monkeyrunner.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 monkeyrunner.
@@ -70,8 +70,7 @@ public class AdbBackend implements IChimpBackend {
return platformTools.getAbsolutePath() + File.separator + SdkConstants.FN_ADB;
}
- return mrParentLocation + File.separator + SdkConstants.FD_OUTPUT +
- File.separator + SdkConstants.FN_ADB;
+ return mrParentLocation + File.separator + SdkConstants.FN_ADB;
}
return SdkConstants.FN_ADB;