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
#!/bin/bash
export ANDROID_HOME=/Users/Robot/Downloads/Xamarin/android-sdk-mac_x86
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/build-tools
‘/Applications/Appiumold.app/Contents/Resources/node/bin/node’ ‘/Applications/Appiumold.app/Contents/Resources/node_modules/appium/bin/appium.js’ --address 127.0.0.1 --command-timeout 7200 --pre-launch --app ‘/Users/Robot/Desktop/Exampletools.apk’ --app-pkg Exampletools.exampletool --app-activity bott.droid.SplashScreenActivity --app-wait-activity bott.droid.SplashScreenActivity
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