5

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

image

Abhimanyu
  • 11,351
  • 7
  • 51
  • 121
  • any error in logcat ? – Dinkar Kumar May 09 '21 at 11:00
  • 1
    uiautomatorviewer itself is not showing me any error for example: if the device is not connected then it should throw an error "no android device detected by ADB" The screenshot button itself is not clickable though I checked in logcat no errors are getting generated – Chandni Makadia May 09 '21 at 11:42
  • I have the same problem btw uiautomaterviewer is not working with newer versions of Java. – Lukas Lewandowski Jun 04 '21 at 13:25

2 Answers2

2

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

0

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.