Cannot run project

Hi,

just starting out with ionic to see if its something I want to work with but I am unable to get the sample project up and running. Terminal output:

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (code=146):
Invalid device state
An error was encountered processing the command (code=146):
Exception encountered connecting to CoreSimulatorBridge: Unable to connect to CoreSimulatorBridge
** RUN SUCCEEDED **

Has anyone come across this at all?

Regards

Just managed to get this working by firstly opening up the simulator using

xcrun instruments -w "iPhone 6 (8.2 Simulator)"

and then rebuilding and emulating. Any reasons why I have to do this?

regards

2 Likes

Thanks @lukesnowden. It helps me.

didn’t work for me :frowning:

do you have xcode 5+ installed?

yes. I managed to fix it by making sure I have the latest ios-sim npm install -g ios-sim and restarting xcode. I think it was an issue with xcode being open or something.

FWIW, I ran into a similar issue and none of the above suggestions quite helped.
At the end it turned out to be a permissions issue, since the project folder was created using ‘sudo’ - see issue https://github.com/driftyco/ionic/issues/4052

In order to get around this, I had to change the ownership of the folder to the user(myself) as pointed out by iamthemovie in his comments in the thread. You could either use CLI or Finder to do this.

I tried consistently using sudo and still have problems running the demo app. Anyone else get this?
Cheers, Pete

~/src/uno/ionic/myApp$ sudo ionic emulate ios



** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (code=146):
Invalid device state
An error was encountered processing the command (code=146):
Exception encountered connecting to CoreSimulatorBridge: Unable to connect to CoreSimulatorBridge
ENOENT, no such file or directory '/Users/peter/Library/Logs/CoreSimulator/93E9DF07-1A3D-4F80-B30E-83FFEB882EAE/system.log’
Error code 1 for command: ios-sim with args: launch,/Users/peter/src/uno/ionic/myApp/platforms/ios/build/emulator/myApp.app,–devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,–stderr,/Users/peter/src/uno/ionic/myApp/platforms/ios/cordova/console.log,–stdout,/Users/peter/src/uno/ionic/myApp/platforms/ios/cordova/console.log,–exit
Error: /Users/peter/src/uno/ionic/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:139: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)

Pete, using Sudo is probably what’s causing the error, have you tried changing the ownership of the folder of your project?

Thanks! I had exactly this problem and changing the ownership of the folder and its contents fixed it:

sudo chown -R yourUsername yourAppFolder