I connect Samsung device via USB to my laptop. When I run the command adb start-server from AndroidStudio/Java project, It doesn't work. The same command works from terminal:
program output:
I/System.out: adb start-server
I/System.out: cannot bind tcp:5038
I/System.out: daemon not running. starting it now on port 5038
I/System.out: exit: 255
Similar thing happends when I run adb -d devices -l command:
I/System.out: adb -d devices -l
I/System.out: cannot bind tcp:5038
I/System.out: daemon not running. starting it now on port 5038
I/System.out: exit: 1
Terminal output:
C:\Users...\Android\Sdk\platform-tools^adb start-server C:\Users...\Android\Sdk\platform-tools^ C:\Users...\Android\Sdk\platform-tools^adb -d devices -l List of devices attached df346805 device product:j53gxx model:SM_J500H device:j53g C:\Users...\Android\Sdk\platform-tools^
The relevant Java command:
Process proc = Runtime.getRuntime().exec("adb start-server");