简体   繁体   中英

uiautomator not clickable in mac

Configuration

OS: macOS Big Sur
Java: 1.8.0_231
Android studio: 4.2

I have also set PATH as below

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home
export ANDROID_HOME=~/Library/Android/sdk
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$JAVA_HOME/lib
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/build-tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/tools/lib/x86_64

When I open uiautomatorviewer from the terminal, the buttons are not clickable.

uiautomatorviewer screen for reference

图片

Try this solution it worked for me:

Download the latest swt.jar, from https://download.eclipse.org/eclipse/downloads/index.html , rename downloaded swt.jar to swt2.jar, copy to Android/sdk/tools/lib/x86_64/ and to Android/sdk/tools/lib/x86 and run uiaautomatorviewer.

source: https://github.com/android/android-test/issues/911

Change swt.jar file in Android/sdk/tools/lib/x86_64/ and tAndroid/sdk/tools/lib/x86. Download swt.jar file of version 4.20 only.Other versions don't work.

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