As you said that you did changes in .bashrc and after that node terminal command for appium server is working fine Which is Great! a step closer .Actually .bashrc file is used for setting variables used by interactive login shells. If you want those environment variables available in Eclipse you need to put them in /etc/environment. if you don’t know how to set /etc/environment, its just a google search away.
You can also define an environment variable that is visible only within Eclipse.
Go to Run -> Run Configurations… and Select tab “Environment”.
Hope This will help you ! Just give a try and let us know.
Thanks,
Donald
Sorry if I’m not being clear. I think Donald had a good point. For me, when I go to run configurations in Eclipse & hit ‘select’, it gives me a list of local variables that I’ve already set & I just pick the one(s) I need. If one is not in there that you need just hit ‘new’, and then set it for Eclipse’s use.
Hello Ashok i had the same issue when i was working in a company before.I usually create a bash file and then use that to open programatically…Here is my code …This will solve the problem
As you can see this is the code i stored in my file in Mac pc.Every time you programatically start it needs to set variables each time.I dont understand what is the problem I hope this fixes your problem
@Donald@wreed I set those environmental as System-wide environmental variables. and it works now.
Previously I didn’t set the environmental variable(ANDROID_HOME) as system-wide variable, that is the reason why the ANDROID_HOME variable is invisible in Eclipse Environment settings.
To set the ANDROID_HOME as System-wide environmental variable, I have used the following commands in terminal and some settings in Eclipse.
Then either restart or run launchctl < /etc/launchd.conf; sudo launchctl < /etc/launchd.conf
Eclipse:
Then the variable becomes visible in the Eclipse–> Run Configurations–> Environment -->Select–>ANDROID_HOME then I checked the ANDROID_HOME variable and click apply. Run the code with your new Run configuration settings. That made my code to work.
@kasperavi Thanks Avinash! Let me check with your idea too…
Thanks a lot to everyone! The big show came to an end
I am facing same issue and am new to mac os. Could you please elaborate the steps for setting the ANDROID_HOME as System-wide environmental variables. Currently I am stuck in second step.
Note;- This issue I am getting when starting appium server programmatically. Through Appium GUI it is working fine and am able to run test scripts.
Please find the following Terminal steps.
sudo nano /etc/launchd.conf —> its launching /etc/launched.conf file
I am able enter “setenv ANDROID_HOME /Users/mobilelabmac/Desktop/adt-bundle-mac-x86_64-20140702/sdk/” in /etc/launched.conf file
Save File Using Command + S
Restarting machine
I can’t see the ANDROID_HOME in Select Environment Variables List in Eclipse.
Please elaborate how to save file and after saving /etc/launched.conf file how to run the third steps commands.
I am getting error “No such file error” when I am hitting the command “launchctl < /etc/launchd.conf; sudo launchctl < /etc/launchd.conf” on Terminal
@nitishram, i had the same issue and got it resolved by adding ANDROID_HOME in the Run Configurations > Environment tab of eclipse. hope it helps to solve yours.
Hi,
I got this in my eclipse console log as an exception. Please help me out. I am using MacOS and the appium server version is 1.5.3. Tried setting up the ANDROID_HOME but of no avail.
Exception in thread “main” org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find adb in tools, platform-tools, or supported build-tools under /Users/amar/Downloads do you have the Android SDK installed at this location? (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 431 milliseconds
Build info: version: ‘2.48.0’, revision: ‘b7b081a’, time: ‘2015-10-07 15:45:39’
System info: host: ‘Amars-MacBook-Pro.local’, ip: ‘172.16.30.86’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.6’, java.version: ‘1.8.0_111’
Driver info: io.appium.java_client.android.AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:89)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:113)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at in.SpekaingTree.SpeakingTreeAppium.main(SpeakingTreeAppium.java:31)