Android: Failed to parse the output of ‘adb version’

I tried to create java app fro connecting to Android device.
Here is the code:

public class Main {

    public static void main(String[] args) throws IOException {

        AndroidDebugBridge adb = AndroidDebugBridge.createBridge("C:\\install\\adt-bundle-windows-x86_64-20130917\\sdk\\platform-tools\\adb.exe", true);
        if (adb == null) {
            System.err.println("Invalid ADB location.");

        IDevice[] iDevices = adb.getDevices();

        AndroidDebugBridge.addDeviceChangeListener(new AndroidDebugBridge.IDeviceChangeListener() {

            public void deviceChanged(IDevice device, int arg1) {
                // not implement

            public void deviceConnected(IDevice device) {
                System.out.println(String.format("%s connected", device.getSerialNumber()));

            public void deviceDisconnected(IDevice device) {
                System.out.println(String.format("%s disconnected", device.getSerialNumber()));



Starting the program returns the error:
Failed to parse the output of 'adb version'

Solution is found on stackoverflow Failed to parse the output of ‘adb version’?
The problem was in COMODO Antivirus. Steps to do in the answer

  • run comodo settings
  • defense+
  • list active processes
  • add adb.exe to trusted processes
  • restart server: run “adb kill-server” “adb start-server”

Leave a Reply

%d bloggers like this: