Getting error Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported

Not sure why I am getting this error in my new machine while starting session in android inspector. In my previous machine it was fine

I already set Android_HOME

I have added in bashrc & zshrc file also

I have tried command echo $PATH but doesn’t show me path
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin

Along with this when I run code in eclipse it gives error " Original error: An unknown server-side error occurred while processing the command. Original error: Device R5CWA1C2ERR was not in the list of connected devices" but I can see device using adb devices

@wreed @ido_oserovitz @Aleksei Could you please help :pray: . It is blocking me from automation

here my config as example:

// check what terminal mode you have
ps -o comm= $$
-bash

// check where is your maven
which mvn
/usr/local/bin/mvn

// check bash profile
open ~/.bash_profile
-> i have only
export ANDROID_HOME=/Users/my_user/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)
and some other specific settings

// check java
java -version
java version "17.0.9" 2023-10-17 LTS

what is your output and what Android inspector you starting? From Android studio is should start without anything doing on computer…


@Aleksei Strange . I can launch application by eclipse IDE script run
But with appium inspector it gives error. Is it something related to uiAutomator?

Error says you need to read instructions for android studio and set environment variables. Have you done that?

For long text errors, please don’t post screenshots. Cut & paste text errors or use git gist for longer logs.

@wreed Yes I have added but still not sure why it is not showing me anything under echo $PATH

I have attached screenshot in my post. Could you please help me :pray:
I am not sure what exactly I am missing and where I need to update

I have fixed issue on my machine
Thanks all

maybe you can share your fix with others …

1 Like