0
votes

I've installed and build ios and all seems ok but when I run 'ionic emulate ios' I get the following error (just running it for the demo myApp):

Updated the hooks directory to have execute permissions Running command: /Users/X/myApp/hooks/after_prepare/010_add_platform_class.js /Users/X/myApp add to body class: platform-ios Running command: /Users/X/myApp/platforms/ios/cordova/run --emulator /bin/sh: ios-sim: command not found

Error: /Users/X/myApp/platforms/ios/cordova/run: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

Anyone have any ideas?

2

2 Answers

0
votes

Did you installed ios-sim?

sudo npm install -g ios-sim

Fix the hooks error permission:

chmod +x hooks/after_prepare/*
0
votes

First, it seems that you do not give 'execute permission' to cordova hooks, so just run:

chmod -R +x hooks/after_prepare

more about hooks issues: http://ionicframework.com/docs/ionic-cli-faq/#hooks.

Secondly, use ionic cli start ios simulator, you must install a utility package called ios-sim:

sudo npm install -g ios-sim

more about ios emulation:http://ionicframework.com/docs/ionic-cli-faq/#ios-emulate.

Hope this will help you. Regards.