4

I am trying the Ionic framework.Everything ran smoothly but when I tried to emulate an iOS app

macbook$ sudo ionic emulate ios

I got the following error:

Password:

....

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator
ENOENT, no such file or directory '/Users/macbook/Library/Logs/CoreSimulator/9F89ED64-0748-4A65-92DF-611110E9D4C4/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/macbook/Documents/workspaceionic/MyTestApp/platforms/ios/build/emulator/MyTestApp.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/macbook/Documents/workspaceionic/MyTestApp/platforms/ios/cordova/console.log,--stdout,/Users/macbook/Documents/workspaceionic/MyTestApp/platforms/ios/cordova/console.log,--exit
Error: /Users/macbook/Documents/workspaceionic/MyTestApp/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.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Process.ChildProcess._handle.onexit (child_process.js:802:5)

do you have any ideas about what could be wrong? I'm using Yosemite and Node version is 0.12.7. iOS apps from XCode emulate fine

EDIT: if I open the project with XCode and emulate it, it works.

Gyonder
  • 3,674
  • 7
  • 32
  • 49

3 Answers3

1

no need for sudo

ionic emulate iOS

is the correct statement

Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
  • I'm having same problem as op, and if i try `ionic xxx` i get a `-bash: ionic: command not found` error. I must use `sudo ionic xxx` instead. (I'm actually on OS X El Capitan building for iOS 9) – Dylanthepiguy Jan 18 '16 at 21:04
1

There are apparently issues with running Node 0.12.x and Ionic. I'm running into this issue, myself, in my c9.io account... the dev environ wants 0.12.x, but Ionic requires 0.10.x. See Anil Singh's response in this thread for more information: With Node 0.12.2 and npm 2.7.4 ionic installation error on windows 7

Community
  • 1
  • 1
0

It's a permission issue, it's resolve my problem,

sudo chown -R $(whoami) ~/Code/ionic-app/