Under Ubuntu (hey it's not Windows but at least it's open source).
After recent upgrade of SDK I tried to start adb but encountered the following Error reported by adb window in IntelliJ...
Unable to detect adb version, adb output: /home/philip/Android/Sdk/platform-tools/adb: 1: /home/philip/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
- From code of AndroidDebugBridge.java at URL https://android.googlesource.com/platform/tools/base/+/master/ddmlib/src/main/java/com/android/ddmlib/AndroidDebugBridge.java where it states...
future.setException(new RuntimeException( "Unable to detect adb version, adb output: " + sb.toString()));
- Therefore one can remove the literal from the reported error and one gets the output of sb.toString(), nest'pas? which is...
/home/philip/Android/Sdk/platform-tools/adb: 1: /home/philip/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
- And sb.toString() should be the result of the following call..
aProcessBuilder(adb.getPath(), "version");
Or in other words "adb getPath version", where to from here?
I can do an ls of the path which reported...
/home/philip/Android/Sdk/platform-tools/adb
No worries about the path, it is correct, also the version was reported as 1
To run AndroidDebugBridge or adb with the command getPath(), "version"
sudo /home/philip/Android/Sdk/platform-tools/adb -getPath -version
/home/philip/Android/Sdk/platform-tools/adb: 1: /home/philip/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
Exactly the same output as reported as an error, so it is either the way path is set up or it is? a joining of a result with an error by adb. This would occur when the Exception was appended to before being caught and printed to output!
Back to the code looking for the error message "Syntax error: " plus error message
NOTHING!
- Has to be the... CAT - it can't be the path because the version has already been reported, try adb -version
adb: 1: /home/philip/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
- This output excludes the path and gives the version PLUS the error message but where does the error message come from?
/home/philip/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
What IF one runs adb -getpath by itself?
/home/philip/Android/Sdk/platform-tools/adb: 1: /home/philip/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
Moo!
Help would be appreciated thanks.