Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In UI automator viewer Error Obtaining Device screenshot, Reason : Error Unable to connect to adb. Check if adb is installed correctly

When I click on UI Automator viewer --> Device screenshot throws Error Unable to connect to adb. Check if adb is installed correctly.

I am trying to run it Appium. I am able to load the apk in the emulator, stuck on the UI Automator viewer due to the adb connection error.

like image 378
ruchir Avatar asked Mar 09 '17 13:03

ruchir


1 Answers

Open with text editor (notepad/vim) the uiautomatorviewer.bat.

Find that line:

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

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

Please notice that you should put your Tools' path after the bindir.

like image 125
ydonev Avatar answered Sep 27 '22 22:09

ydonev