I have my own node application and with that I am trying to execute below appium command to start appium server: /usr/local/bin/node /usr/local/lib/node_modules/appium/build/lib/main.js --address 0.0.0.0 --port 4723
Now problem is it works successfully if this command or my node application is executed via terminal, on directly running app by double clicking appium gives the below error:
appium server stdout: [BaseDriver] Session created with session id: 3c772bb0-4c0d-4687-bb5b-d475d039ad7b[UiAutomator2] Starting 'com.google.android.apps.messaging' directly on the device[ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
/Applications/myapp.app/Contents/Resources/app/scripts/appiumConfigHandler.js:20 appium server stdout: [debug] [UiAutomator2] Deleting UiAutomator2 session
/Applications/myapp.app/Contents/Resources/app/scripts/appiumConfigHandler.js:20 appium server stdout: [debug] [BaseDriver] Event 'newSessionStarted' logged at 1594207927588 (17:02:07 GMT+0530 (India Standard Time))
/Applications/myapp.app/Contents/Resources/app/scripts/appiumConfigHandler.js:20 appium server stdout: [debug] [W3C] Encountered internal error running command: Error: Could not find 'adb' in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the correct Android SDK root directory path.[debug] [W3C] at ADB.getBinaryFromPath (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:140:11)
/Applications/myapp.app/Contents/Resources/app/scripts/appiumConfigHandler.js:20 appium server stdout: [debug] [W3C] Destroying socket connection
/Applications/myapp.app/Contents/Resources/app/scripts/appiumConfigHandler.js:20 appium server stdout: [HTTP] <-- POST /wd/hub/session 500 5367 ms - 791
/Applications/myapp.app/Contents/Resources/app/scripts/appiumConfigHandler.js:20 appium server stdout: [HTTP]
I have ANDROID_HOME already settled up in ~/.bash_profile and even platform tools, build tools and tools are all are in the bash profile.
Please suggest what could be the solution for setting up appium in such a way so that it can run globally this not only from terminal.
Hi reed, It did not work with bashrc, application is also executing under same user, then I worked it out with using a plist to run shell script file which sets all the paths of the bash_profile to globally,
but I am still getting issue with Carthage. But in the same way, I am not able to set carthage as globally, carthage is installed properly and in working state, it is launching application when starting from terminal, so I guess again same environment issue.
Below is the issue I am getting with appium:
appium server stdout: [debug] [W3C] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: not found: carthage
Any solution for Carthage? How can I make it available?
Can you check these values in your code with some print statements before you hit the error? That way you can see for sure what exactly is getting to your application.
After that I’d try messing around with your script. I don’t know the difference between ‘${PATH}’ and ‘$PATH’, so I’d be curious if that made some kind of difference. Maybe try refactoring your ‘export PATH’ statements into less statements.
You might also include in your print statements the value of $SHELL. Just in case
Wow. So zsh won’t read .bash_profile or .bashrc files. Super glad I asked what I thought at the time might be a dumb question. You can set these environment variables in one of the 5 zsh startup files: