Android Home not set while run it from command line

Hi ,

When I run script from /usr/Local/bin> I get below error but in appium GUI it works fine for me.

Basically I run appium from mac /usr/Local/bin> sudo node appium --nodeconfig /Users/ramshankar_behra/Documents/MobileAutomationSoftwares/first.json -p 4723

similarly with different port as well. tried the same with different json.

Could somebody please suggent where did I miss ?

You need to add below in PATH
$ANDROID_HOME/build-tools/23.0.1

If you are running the script using ‘sudo’ then the super user needs to have the Android Home set. The super user (root) won’t read the user who called it’s Android Home.