Nabila
Nabila

Reputation: 191

Mac OS: Android Studion ADB connection error

I want to start my app on my device or an emulator but I cant since Adb won't start. Adb works just fine when called from the command line but it can't run on android studio. when I run adb start-server it runs successfully. I have changed the default android server port to 12345 since the 5037 is used.

Here are the results of adb devices and adb start-server commands:

adb devices

List of devices attached

0e6acf5f2599540e device

and

adb start-server

  • daemon not running. starting it now on port 12346 *
  • daemon started successfully *

In the idea.log file I have the following error:

java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:205) at com.android.tools.idea.ddms.adb.AdbService$1.run(AdbService.java:232) at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2016-12-27 10:44:32,484 [3713735] WARN - #com.android.ddmlib - '/Users/nabila/Library/Android/sdk/platform-tools/adb,start-server' failed -- run manually if necessary

Android Studio version: 2.2.3 Android Debug Bridge version 1.0.36 Revision 0e9850346394-android

Thanks in advance

Upvotes: 0

Views: 3541

Answers (2)

Nabila
Nabila

Reputation: 191

The problem was due to running processes on the 5037 port. Even if adb has been configured to run on the 12345 port android studio still uses 5037.

Execute:

sudo lsof -i :5037

and kill all active processes.

Upvotes: 2

Umar Ata
Umar Ata

Reputation: 4268

try these commands

adb kill-server

to kill the existing server

then

adb devices

to start a new server

then go to developer options of your phone and revoke all usb authorization then reconnect your device with useb and it will ask to accept the RSA fingerprint and you done.

you may also use adb -P 1234 start-server to start the adb server to 1234 port

Upvotes: 0

Related Questions