1

I'm getting this following error after I ran my app on my own ios device.

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 '/Users/cauealmeida/Library/Logs/CoreSimulator/5C6DA43E-3993-4260-87EE-73FEB27DE181/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/cauealmeida/Documents/jobs/dev/ionic-maptest/map-test/platforms/ios/build/emulator/map-test.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/cauealmeida/Documents/jobs/dev/ionic-maptest/map-test/platforms/ios/cordova/console.log,--stdout,/Users/cauealmeida/Documents/jobs/dev/ionic-maptest/map-test/platforms/ios/cordova/console.log,--exit
Error: /Users/cauealmeida/Documents/jobs/dev/ionic-maptest/map-test/platforms/ios/cordova/run: Command failed with exit code 2

I've tried with ionic emulate ios -cls from different projects and the same error is shown.

What am I missing?

Selva
  • 338
  • 2
  • 12
Adam
  • 33
  • 8

3 Answers3

2

Here are the steps you can use to correct this issue:

1) Empty the 'platforms' folder in your Ionic project

2) Re-run ionic platform add ios, ionic build ios, and ionic emulate ios without sudo

3) Still getting a permissions error, make sure all the files in your user's home folder actually belong to that user by running

sudo chown -R username /Users/username

N.Raval
  • 549
  • 3
  • 11
1

We fixed this using the SO answer here, which was just to Reset Content and Settings in the Simulator menu.

Community
  • 1
  • 1
theblang
  • 10,215
  • 9
  • 69
  • 120
0

You need to download ios simulator. Go to xcode and download ios 9 or other simulator.

you also need to install ios-sim using your terminal.

sudo npm install -g ios-sim

also check and confirmed your device is connected properly. connected device you see in xcode window

SuReSh
  • 1,503
  • 1
  • 22
  • 47