Rahul Sharma Rahul Sharma - 7 days ago 5
Android Question

Error: Could not find or load main class com.android.uiautomator.UiAutomatorViewer

I am trying to run Android's UiAutomatorViewer on ubuntu system but when i run this command

uiautomatorviewer
it gives this error:
Error: Could not find or load main class com.android.uiautomator.UiAutomatorViewer
I have set path to .bashrc file:

export ANDROID_HOME=/home/rahulsharma/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


When i run other program of tools folder like sdk manager, that executes successfully.
Does anyone know where i am doing mistake?

enter image description here

Answer

Could not find the reason that why i am getting this error but found solution. To start UiAutomatorViewer:

  • Open terminal
  • In terminal go to tools folder inside android sdk
  • run ./uiautomatorviwer command.

Ui Automator Viwer is running now. May be helpful for someone.

Comments