iOS simulator - ssh started appium server?

I’m trying to have my appium testing fully automated, starting and killing the appium servers on a Mac through ssh for both iOS and Android. Everything works fine when testing with Android AVDs. iOS simulators fail to load when the server is started via ssh but work when started through terminal on the Mac.

info: [debug] [INST] Waiting for device to boot…
info: [debug] [INST STDERR] 2014-11-27 10:42:16.919 instruments[20471:8991988] [MT] iPhoneSimulator: Could not launch simulator: -600
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: aborting run.

Any suggestions?

Found a solution through a bunch of trial and error.

Through ssh:
open /AppBuild/AutomationScripts/test.sh -a /Applications/Utilities/Terminal.app

test.sh:
#!/bin/bash

@Simon_ ,

I am also facing the same issue which you poster and i tried your suggestion but the simulator is launched

Note : session is created but Getting the below error so please help me to get rid of this issue

in logs
[debug] [INST] Waiting for device to boot…

2015-12-18 15:43:19:954 - info: node-simctl: Executing: xcrun with args: simctl erase E77020CC-7B90-4679-954A-334154D27A0B and timeout: 2000
2015-12-18 15:43:20:549 - info: [debug] Cleaning app data files
2015-12-18 15:43:20:550 - warn: Applications directory /Users/mobilegrid/Library/Developer/CoreSimulator/Devices/E77020CC-7B90-4679-954A-334154D27A0B/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?
2015-12-18 15:43:20:550 - warn: Applications directory /Users/mobilegrid/Library/Developer/CoreSimulator/Devices/E77020CC-7B90-4679-954A-334154D27A0B/data/Containers/Bundle/Application doesn’t exist. Have you run this simulator before?
2015-12-18 15:43:20:551 - info: Couldn’t find app directories to delete. Probably it’s not installed
2015-12-18 15:43:20:551 - info: [debug] Resetting Content and Settings for Simulator
2015-12-18 15:43:20:552 - info: node-simctl: Executing: xcrun with args: simctl erase E77020CC-7B90-4679-954A-334154D27A0B and timeout: 2000
2015-12-18 15:43:20:727 - info: [debug] Cleaning up appium session
2015-12-18 15:43:20:729 - error: Failed to start an Appium session, err was: Error: Instruments never checked in
2015-12-18 15:43:20:732 - info: [debug] Error: Instruments never checked in
at [object Object].Instruments.onInstrumentsExit (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:444:31)
at [object Object]. (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:355:12)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
2015-12-18 15:43:20:732 - info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Instruments never checked in)”,“origValue”:“Instruments never checked in”},“sessionId”:null}
2015-12-18 15:43:20:735 - info: <-- POST /wd/hub/session 500 384331.233 ms - 178
2015-12-18 15:43:21:602 - info: --> GET /wd/hub/status {}
2015-12-18 15:43:21:603 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.16”,“revision”:“ae6877eff263066b26328d457bd285c0cc62430d”}}}
2015-12-18 15:43:21:604 - info: <-- GET /wd/hub/status 200 2.451 ms - 105 {“status”:0,“value”:{“build”:{"versi