Not able to run sample app on iOS simulator

Steps that I did

sudo npm install -g cordova
sudo npm install -g ionic
sudo ionic start myApp sidemenu
cd myApp
sudo ionic platform add ios
sudo ionic build ios
sudo ionic emulate ios

Error message

Foobazs-iMac:myApp foobazlabs$ sudo ionic emulate ios
Running emulate task...
Emulating app on platform ios
Running command: /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/cordova/run --emulator
Build settings from command line:
    ARCHS = i386
    CONFIGURATION_BUILD_DIR = /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/build/emulator
    SDKROOT = iphonesimulator7.0
    VALID_ARCHS = i386


Check dependencies


Check dependencies

ProcessInfoPlistFile build/emulator/ HelloCordova/HelloCordova-Info.plist
    cd /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios
    setenv PATH "/Applications/"
    builtin-infoPlistUtility /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/HelloCordova/HelloCordova-Info.plist -genpkginfo /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/build/emulator/ -expandbuildsettings -format binary -platform iphonesimulator -o /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/build/emulator/

PhaseScriptExecution Copy\ www\ directory build/
    cd /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios
    /bin/sh -c /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/build/

real	0m0.421s
user	0m0.088s
sys	0m0.107s

Touch build/emulator/
    cd /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios
    setenv PATH "/Applications/"
    /usr/bin/touch -c /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/build/emulator/


2014-06-29 18:05:47.803 ios-sim[3854:707] stderrPath: /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/cordova/console.log
2014-06-29 18:05:47.804 ios-sim[3854:707] stdoutPath: /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7fc3f2306b60 {NSLocalizedDescription=Simulator session timed out.}
Error: /usr/local/lib/node_modules/cordova/bin/myApp/platforms/ios/cordova/run: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:755:16)
    at Process.ChildProcess._handle.onexit (child_process.js:822:5)
ERROR: Unable to emulate app on platform ios. Please see console for more info.

OS - Mac OS X 10.8.5

npm version output

{ http_parser: '1.0',
  node: '0.10.29',
  v8: '',
  ares: '1.9.0-DEV',
  uv: '0.10.27',
  zlib: '1.2.3',
  modules: '11',
  openssl: '1.0.1h',
  npm: '1.4.14',
  'ionic-project': '1.0.0' }

Do you have ios-sim installed? ios-sim is required to emulate to the ios simulator.

Hi, sorry for the delayed reply.

Yes, I do have it installed. Ran the

sudo npm install -g ios-sim

command to install it.

I should mention that the Simulator actually starts up, but after half a minute of nothing loading… this error shows up and the Simulator shuts down.

Yeah this is a common issue with ios-sim, If you go back to the ios-simulator’s home screen and the app should be loaded on the device. It’s a bug with the plugin, you should open an issue for it on the github repo

Whenever I try to run my Cordova app from Visual Studio 2013 to Mac Simulator, I am facing this error “Cannot POST /build/tasks?command=build&vcordova=4.3.1&cfg=debug 404” in Mac terminal as well in Visual Studio.

I am facing this error even if I am building/rebuilding my VS. It seems like it tries to connect to Mac machine but due to some reason it could not able to do so and shows this message/error on Mac as well in VS.

On Mac Machine I have run the command vcremote --secure false which in turn has made remote build server listening on port 3030. I have also setup Remote Agent Configuration in VS.

Because I am newbie so It getting really hard for me to figure what is going wrong here? Please advice me. Thanks…