ionic-framework: bug: BUG can't open ios simulator with xcode 7

Type: <span ionic-type>bug</span>

Platform: <span ionic-platform>ios</span> <span ionic-platform-version>8</span> <span ionic-webview>webview</span>

<span ionic-description>I install cordova and ionic to develop app with ios, my xcode version is 7.1.0, but when i use command

ionic emulate ios

the Simulator opened, but do nothing.

and moment for a while, the terminal show the log, like below:

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
ENOENT: no such file or directory, stat '/Users/Fernando/Library/Logs/CoreSimulator/3804D671-203A-45F2-A689-1D18D049EC91/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/Fernando/Develop/dev/Javascript/Demos/ionic_demo/platforms/ios/build/emulator/HelloCordova.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/Fernando/Develop/dev/Javascript/Demos/ionic_demo/platforms/ios/cordova/console.log,--stdout,/Users/Fernando/Develop/dev/Javascript/Demos/ionic_demo/platforms/ios/cordova/console.log,--exit
Error: /Users/Fernando/Develop/dev/Javascript/Demos/ionic_demo/platforms/ios/cordova/run: Command failed with exit code 2

I can’t resolve this iuuse. I have reinstall node, and reinstall cordova and ionic. And this issue always in.

ionic info

Your system information:

Cordova CLI: 5.4.0
Gulp version:  CLI version 3.9.0
Gulp local:  
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.2 
ios-sim version: 5.0.3 
OS: Mac OS X El Capitan
Node Version: v5.1.0
Xcode version: Xcode 7.1.1 Build version 7B1005

How can I solve this issue?</span>

<span is-issue-template></span>

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 38 (3 by maintainers)

Most upvoted comments

Looks like the command line tools with Xcode weren’t installed. Make sure they’re install by opening Xcode or running xcode-select --install from the command line.

hey guys!

I have the same problem when I try to emulate iOS platform

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-SE, 10.0 simulator

An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163): Invalid device state

An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163): Invalid device state

Error: ENOENT: no such file or directory, stat ‘/Users/Leith/Library/Logs/CoreSimulator/81DA68A9-07E9-4202-B985-8D9B106F458E/system.log’

bash-3.2#

I tried to looking for any solution about this…but I can’t find something good.

Any idea? Thanks!

Ok this is what worked for me.

  1. Uninstall/ Fresh Install Xcode.
  2. Follow this guide to use npm without sudo: http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/
  3. run: npm -g install ios-sim

Having the same problem, and no solution found after read the whole thread.

¿Any help?

Alright guys, I went through all of these suggestions and none of them helped me. For those unlucky few that still get

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state

Open your Xcode project, then run it on the iPhone 6 emulator. After doing that step, I was able to use ionic emulate ios and ionic emulate ios -lcs ಠ_ಠ

@BenjaminConant I’m seeing the same issue, the emulator doesn’t start properly. The project seems to build, then starts a blank window, and after a while the console exits with:

No target specified for emulator. Deploying to iPhone-6s-Plus, 9.3 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
Error: ENOENT: no such file or directory, stat '/Users/[username]/Library/Logs/CoreSimulator/8776EAE5-33FF-40FC-B75D-4204851C010E/system.log'

Recursive chowning hasn’t helped, nor sudo npm installing ios-sim and ios-deploy. Given it’s a first run for me on ios development, it might be that I’m just missing something, or it could be a real issue for the few of us.

Hi all,

Have tried everything in this thread and still getting the same issue … I can open up the project in xcode and run the emulator from there and everything works great. I cannot, however, open the emulator from the terminal with ionic emulate ios … when i do run ionic emulate ios i get

** BUILD SUCCEEDED **

the emulator opens but is just a black screen and then after a while the terminal logs

No target specified for emulator. Deploying to iPhone-6 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state

here is my ionic info

ordova CLI: 6.0.0
Gulp version:  CLI version 3.9.0
Gulp local:
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.0.0
Xcode version: Xcode 7.2.1 Build version 7C1002

Anyone else seeing behavior like this or have any ideas? Would be much appreciated!

@oneboxteam’s link didn’t work for me. But running “ionic state reset” did.

You should launch the xcode ,and select /platform/ios/xxxx.xcodeproj path and build on ur iphone or launch the simulator , and run the terminal ,then it works