Getting osacript error when trying to create iosDriver

I am frequently getting the below issue when trying to run multiple IOS simulators

Error occurred while creating ios driver object: An unknown server-side error occurred while processing the command. Original error: Command ‘osascript -e ‘tell application “System Events” to count processes whose bundle identifier is “com.apple.iphonesimulator”’’ exited with code 1 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.51 seconds
Note: i am running test cases in parallel by opening different versions of simulator
I am using the below versions

Xcode-9-beta
[email protected]

Any help will be appreciated

@munismajeed check in case that dev mode enabled on your mac:

$ DevToolsSecurity -status
Developer mode is currently disabled.

$ DevToolsSecurity -enable
Developer mode is now enabled.

@Aleksei
it is enabled only

@munismajeed - Did you find out why you were getting this error? My tests run fine locally, but I’m getting this when I try to run them through Jenkins. I checked DevToolsSecurity on my machine, and it is enabled.

Edit: I am using the following:
Xcode Version 9.0 (9A235)
Appium 1.7.1

I’m wondering if this has anything to do with Xcode 9… I was able to run tests locally on Jenkins a few months ago. I documented every error that I came across in my setup process, and I never saw this. I’m just becoming aware of osascript by troubleshooting this issue.

Update: I downgraded to Xcode 8.3.3 and I’m still seeing the same issue. The simulator is not starting up, but the Appium Server is starting. The Console Output in Jenkins shows that the first test actually fails due to an ElementNotFound exception, so the test isn’t getting killed at the point where this exception is caught.

I’ll start a new thread since this is Jenkins-specific.

Final update: Jenkins-specific thread is here: Appium tests via Jenkins: Simulator not booting, error: Command 'osascript -e 'tell application "System Events" to count processes whose bundle identifier is "com.apple.iphonesimulator"

Same issue here.
Help needed!!!

I am also experiencing this. Anyone know what’s going on here?

I am experiencing this only when I restart the node by command line. After login in by GUI in the Jenkins node, the issue was fixed. I guess my issue is related system auth.