简体   繁体   中英

UI Automator doesn't start in OSX

yogevabergel [~/Library/Android/sdk/tools/bin] $ ./uiautomatorviewer
-Djava.ext.dirs=/Users/yogevabergel/Library/Android/sdk/tools/lib/x86_64:/Users/yogevabergel/Library/Android/sdk/tools/lib is not supported.  Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Any help? Nothing in the internet about it.

First, check you set properly system variables like JAVA_HOME & ANDROID_HOME and that tools are in place, easy way is to use appium-doctor for this:

npm appium-doctor -g
appium-doctor --android

And fix any error you get.

It can be also that you miss some component in android-sdk-tools:

  1. Launch Android Studio
  2. Configure => SDK manager
  3. On SDK Tools tab check status for Platform-Tools & SDK Tools, update if possible

Which java version are you running? I hit the same issue with Java v.10, installed Java v.8, updated ~/.bash_profile with

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) 

and it helped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM