NaN
NaN

Reputation: 1072

Unable to connect to adb. Check if adb is installed correctly

I have an AVD (platform version 4.2.2) running on emulator which actually shows up if I type adb devices in the terminal window.

When I try to run "Device Screenshot" in uiautmatorviewer, I got an error saying "Unable to connect to adb. Check if adb is installed correctly". I'm stuck trying to have uiautomatorviewer recognise my emulator.

Here is the screenshot showing details of AVD if that helps:

AVD properties screenshot

Upvotes: 2

Views: 10677

Answers (3)

Ritesh Toppo
Ritesh Toppo

Reputation: 333

If anyone facing this issue. check if platform-tools folder is present inside android sdk folder. There must be platform-tools and tools folder. if not present copy and paste platform-tools folder inside sdk folder

Upvotes: 1

Ashish Chaturvedi
Ashish Chaturvedi

Reputation: 31

Open uiautomator.bat file in notepad. and find below line

call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir= -jar %jarpath% %*

and change it to

call "%java_exe%" "-Djava.ext.dirs=%javaextdirs%" "-Dcom.android.uiautomator.bindir=C:\DEV\androidSDK\tools" -jar %jarpath% %*

Upvotes: 3

krit
krit

Reputation: 41

In my case, the adb.exe file was somehow missing from the android -> tools folder.So I copied it to that and now it's working for me.

Upvotes: 3

Related Questions