At the time of writing this blog. Some tools (Like
uiautomatorviewer) in the Android SDK are not compatible with ARM macOS.
uiautomatorvieweris a Java program. It can be easily “hacked” to run on ARM machines.
- JRE 8. I chose
Zulu-8(Java 9+ may has more difficulties to work well. I gave up to make it run on
- Eclipse SWT 4.20 for macosx-aarch64
Goto the Android SDK tools directory.
cp lib/x84_64/swt.jar lib/aarch64/swt.jar
Copy SWT 4.20 jar to
cp /downloaded/swt/jar/path lib/aarch64/swt2.jar
Make sure you are currently running Java 8
ANDROID_HOME/tools, run the command:
Since Java 9,
-Djava.ext.dirs parameter was unsupported.
You should try to use
-classpath is useless when using
To add external classes when running a jar, should use
java -Xbootclasspath/a:"lib/aarch64/swt2.jar:lib/aarch64/swt.jar:lib/others.jar" -XstartOnFirstThread -jar lib/uiautomatorviewer-26.0.0-dev.jar
I’ve tried this, but ran into some other issues.