Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic emulate Ios fails to run The session does not open my app

Ionic emulate ios failed on Mac OS Yosemite. Their have some cases were the ios device emulated, but shortly after the terminal console shoots up the error message below.

** 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/yay/Library/Logs/CoreSimulator/2CAA2C39-7F22-4AF2-BBDE-86609188F37C/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/yay/code/myApp/platforms/ios/build/emulator/myApp.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/yay/code/myApp/platforms/ios/cordova/console.log,--stdout,/Users/yay/code/myApp/platforms/ios/cordova/console.log,--exit
Error: /Users/yay/code/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:134: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)
like image 551
sanoy Avatar asked Jul 07 '15 22:07

sanoy


Video Answer


2 Answers

The issue is because you used sudo to create and/or build the project.

Just input these commands (without the $ of course):

1) Remove with sudo

$ sudo ionic platform remove ios

2) Add iOS back without sudo

$ ionic platform add ios

3) Run iOS emulator

$ ionic emulate ios

Source: https://github.com/driftyco/ionic/issues/4052 (rajkotecha's comment)

like image 176
Alex Pan Avatar answered Oct 02 '22 10:10

Alex Pan


Do NOT use sudo when creating or building the project.

Please see https://github.com/driftyco/ionic/issues/4052

like image 38
code4jhon Avatar answered Oct 02 '22 10:10

code4jhon