Platforms/ios/cordova/run: Command failed with exit code 2 You may not have the required environment or OS to run this project cordova process is exiting

Hi I get this error message when after

$ ionic run -l -s -c ios

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator
2015-04-11 11:47:47.353 ios-sim[15003:5000841] stderrPath: /Users/larpo/m7.entrusters/platforms/ios/cordova/console.log
2015-04-11 11:47:47.354 ios-sim[15003:5000841] stdoutPath: /Users/larpo/m7.entrusters/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 “Timed out waiting for device to boot” UserInfo=0x7f901da000c0 {NSLocalizedDescription=Timed out waiting for device to boot}
Error code 1 for command: ios-sim with args: launch,/Users/larpo/m7.entrusters/platforms/ios/build/emulator/m4.entrusters.app,–devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,–stderr,/Users/larpo/m7.entrusters/platforms/ios/cordova/console.log,–stdout,/Users/larpo/m7.entrusters/platforms/ios/cordova/console.log,–exit
ERROR running one or more of the platforms: Error: /Users/larpo/m7.entrusters/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
cordova process is exiting

The emulator loads ok and the app is usable but live reload and logging is not working.

I have updated cordova, removed platforms/ios directory and plugins/ios.json and run

$ ionic platform add ios 

again, but to no avail. Grateful for any help

If anyone gets this, I found a fix that works for me. Turns out in my case it was a permissions issue in the project directory. The following two commands sorted me out (replace [user] with your currently logged in user obv:

sudo chown -R [user] /usr/local/lib/node_modules/cordova

Then while in the project dir:

sudo chown [user] *

and

sudo chmod -R 777 *

Thank you! This helped me a ton.

This didn’t work for me, anyone update on a fix for this issue?

Well, it turns out that the app needs permission to access some file, so I removed the platform content and ran the following three commands:

sudo chown -R username /Users/username/.config/configstore/bower-github.json
sudo chown -R username /Users/username/.config/configstore/insight-cordova.json
sudo chown -R username /Users/username/.config/configstore/update-notifier-cordova.json

This link gave me the heads up. However, you don’t have to grant everything permission just the three files needs the permission.