Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIAUTOMATORVIEWER: SWT folder does not exist on MAC #1243

Closed
walidsabir opened this issue Jan 18, 2022 · 23 comments
Closed

UIAUTOMATORVIEWER: SWT folder does not exist on MAC #1243

walidsabir opened this issue Jan 18, 2022 · 23 comments

Comments

@walidsabir
Copy link

Description

Hi there,
When I try to run UIAUTOMATORVIEWER I get the following error:

**

SWT folder '/Users/XXXX/Library/Android/sdk/tools/lib/aarch64' does not exist.

Please export ANDROID_SWT to point to the folder containing swt.jar for your platform.

**

Here's my bash profile

**

export JAVA_HOME=$(/usr/libexec/java_home)

export PATH=${JAVA_HOME}/bin:$PATH

export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk

export PATH=$PATH:/usr/local/git/bin:/usr/local/bin:

export PATH=$PATH:$ANDROID_HOME/platforms-tools

export PATH=$PATH:$ANDROID_HOME/tools

export PATH=$PATH:$ANDROID_HOME/tools/bin

export PATH=$PATH:$ANDROID_HOME/emulator

export PATH=$PATH:$ANDROID_HOME/tools/lib

**

Here's my Java version:

**

java version "17.0.1" 2021-10-19 LTS

Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)

Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

**

Here's my Mac info: Mac OS Big Spur, M1 ship

Thank you

Steps to Reproduce

Expected Results

Actual Results

AndroidX Test and Android OS Versions

Link to a public git repo demonstrating the problem:

@brettchabot
Copy link
Collaborator

This repository is for issues with the android.test libraries not studio tools. I'd suggest to file this bug into https://source.android.com/setup/contribute/report-bugs 'Android Studio"

@ManishaJoshi-mj
Copy link

Hello, facing the same issue yet. let me know if anybody finds the solution for this.

@thouger
Copy link

thouger commented Mar 11, 2022

same problem,see like incompatible m1

@meghavinay0309
Copy link

I am facing similar issue. Tried to export path of ANDROID_SWT but its not working!

@tahir-akhlaq
Copy link

Any Solution for this

@jlmalone
Copy link

jlmalone commented May 2, 2022

I experience this also. Please let me know if a solution is found

@ManishaJoshi-mj
Copy link

ManishaJoshi-mj commented May 2, 2022 via email

@singulart
Copy link

Same problem on mac book pro with apple silicon M1 Pro

@karlajusten
Copy link

I'm facing the same issue. I use mac book pro with apple silicon M1 Pro

@vipost28
Copy link

vipost28 commented Jul 10, 2022

I managed to solve this by adding JAVA_HOME path in my .zshrc file (I'm using MBP m1):
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home

Before I had this path and it didn't work:
export JAVA_HOME=$(/usr/libexec/java_home)

But it's very important to download JDK SE from Oracle web site (it's called something like "jdk-8u333-macosx-x64"). Before I had Java 18 installed and it seems like it didn't work.

So now all related paths in the . zshrc file are:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home
export DEVICE='android'
export ANDROID_HOME=/Users/username/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/emulator:$PATH

export PATH=${JAVA_HOME}/bin:$PATH
export PATH=${PATH}:/$ANDROID_HOME/platform-tools:/$ANDROID_HOME/tools:/$ANDROID_HOME/tools/bin


I guess that the last are not needed, but I'm not really experienced, so I leave these in the paths as well.
So now

@yuhuazhu
Copy link

yuhuazhu commented Aug 4, 2022

the same issues with mba m1
when i use oracle jdk8,not zulu jdk,uiautomatorviewer is work

@ViktorVoin
Copy link

ViktorVoin commented Dec 20, 2022

I managed to solve this by adding JAVA_HOME path in my .zshrc file (I'm using MBP m1): export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home

Before I had this path and it didn't work: export JAVA_HOME=$(/usr/libexec/java_home)

But it's very important to download JDK SE from Oracle web site (it's called something like "jdk-8u333-macosx-x64"). Before I had Java 18 installed and it seems like it didn't work.

So now all related paths in the . zshrc file are: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home export DEVICE='android' export ANDROID_HOME=/Users/username/Library/Android/sdk export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/build-tools:$PATH export PATH=$ANDROID_HOME/tools:$PATH export PATH=$ANDROID_HOME/emulator:$PATH

export PATH=${JAVA_HOME}/bin:$PATH export PATH=${PATH}:/$ANDROID_HOME/platform-tools:/$ANDROID_HOME/tools:/$ANDROID_HOME/tools/bin

I guess that the last are not needed, but I'm not really experienced, so I leave these in the paths as well. So now

This work for Mac air M1.

@tilalapradip
Copy link

This reference helped me to fix this issue on My MacBook pro m1, https://www.youtube.com/watch?v=raG9TJWKxR4

@juanmendez
Copy link

This reference helped me to fix this issue on My MacBook pro m1, https://www.youtube.com/watch?v=raG9TJWKxR4

confirming this worked for me as of now.

Initially it wasn't working because I had java_home set to Android Studio in my ~/.zshrc

export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"

I made sure to point to another jvm I had already installed..

export JAVA_HOME="/Users/me/Library/Java/JavaVirtualMachines/corretto-1.8.0_322/Contents/Home"

Possibly in anyone's case point to the java_home set by default.

I am just glad there is a way to get this fixed because I really miss this automator for several years already.

@TarCV
Copy link

TarCV commented Mar 9, 2023

I've made a fork of uiautomatorviewer because of similar issues - https://github.com/TarCV/uiautomatorviewer-gradle Works good for me so far. Hope it would be useful for others too.

@TWiStErRob
Copy link
Contributor

Re: the closing #1243 (comment)

There are numerous similar issues open on the Google IssueTracker, followers might want to vote these if they're affected.

Also I think uiautomatorviewer might've been been discontinued as a tool, because it didn't exist in the latest SDK: https://stackoverflow.com/a/75631434/253468.

@in509
Copy link

in509 commented Sep 30, 2023

For me another prerequisite is it's also depends on the JDK version, for me the 1.8.0.331 working well, however 1.8.0.381 doesn't

@rcmrlzl
Copy link

rcmrlzl commented Oct 7, 2023

I managed to solve this by adding JAVA_HOME path in my .zshrc file (I'm using MBP m1): export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home

Before I had this path and it didn't work: export JAVA_HOME=$(/usr/libexec/java_home)

But it's very important to download JDK SE from Oracle web site (it's called something like "jdk-8u333-macosx-x64"). Before I had Java 18 installed and it seems like it didn't work.

So now all related paths in the . zshrc file are: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home export DEVICE='android' export ANDROID_HOME=/Users/username/Library/Android/sdk export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/build-tools:$PATH export PATH=$ANDROID_HOME/tools:$PATH export PATH=$ANDROID_HOME/emulator:$PATH

export PATH=${JAVA_HOME}/bin:$PATH export PATH=${PATH}:/$ANDROID_HOME/platform-tools:/$ANDROID_HOME/tools:/$ANDROID_HOME/tools/bin

I guess that the last are not needed, but I'm not really experienced, so I leave these in the paths as well. So now

works for me! macbook air m1 (I changed my jdk from "jdk-8u381-macosx-aarch64" to "jdk-8u202-macosx-x64")

@kenyee
Copy link

kenyee commented Nov 30, 2023

This hack from this blog works: https://blog.i1nfo.com/posts/uiautomatorviewer/index.html#Preparations
But I keep getting an error of "Error taking device screenshot: EOF".

@pmaheshchauhan
Copy link

pmaheshchauhan commented Feb 18, 2024

I am having macbook m3 pro tried all the above things still unable to start the ui automatorviewer
Could some one help me on this one

@nauman404
Copy link

All above tricks didn't work for me on M3 MBP.

@PinChangKikaTech
Copy link

All above tricks didn't work for me on M3 MBP.

All above tricks didn't work for me on M2 MBP.

@gumaola
Copy link

gumaola commented Oct 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests