问题
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?
回答1:
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
./uiautomatorviwercommand.
Ui Automator Viwer is running now. May be helpful for someone.
回答2:
In my case, the uiautomatorviewer is located inside <android-sdk>/tools/bin
- Open terminal, go to
<android-sdk>/tools/bin - run
./uiautomatorviewer
Hope this will be helpful.
来源:https://stackoverflow.com/questions/40718487/error-could-not-find-or-load-main-class-com-android-uiautomator-uiautomatorview