Can't emulate iOS after install ngCordova


#1

I installed ngCordova using:

  • bower install ngCordova --save

Then I included it in my index.html (before cordova.js):

<script src="lib/ngCordova/dist/ng-cordova.js"></script>

And included it as a dependency:

angular.module('myApp', ['ngCordova'])

My project builds fine but when I try to emulate it, I get:

** BUILD SUCCEEDED **
2014-10-06 13:56:47.731 ios-sim[21159:507] stderrPath:/Users/piet/Sites/mobile/platforms/ios/cordova/console.log
2014-10-06 13:56:47.732 ios-sim[21159:507] stdoutPath: /Users/piet/Sites/mobile/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7fa252e0fce0 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/piet/Sites/mobile/platforms/ios/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Any ideas?


#2

npm -g update ios-sim

Also try “Reset Content and Setting” on the simulator.


#3

@gabber

Thanks for the reply. I updated my ios-sim and “Reset Content and Setting” but I still get roughly the same error:

2014-10-06 14:56:51.769 ios-sim[49820:507] stderrPath: /Users/piet/Sites/mobile/platforms/ios/cordova/console.log
2014-10-06 14:56:51.770 ios-sim[49820:507] stdoutPath: /Users/piet/Sites/mobile/platforms/ios/cordova/console.log
Usage of '--family' is deprecated in 3.x. Use --devicetypeid instead.
Usage of '--retina' is deprecated in 3.x. Use --devicetypeid instead.
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7fd73d900130 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/piet/Sites/mobile/platforms/ios/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5) 

Note the added lines:

Usage of '--family' is deprecated in 3.x. Use --devicetypeid instead.
Usage of '--retina' is deprecated in 3.x. Use --devicetypeid instead.

Any other suggestions?


#4

This happend only after you included ngCordova? You could also try to remove and again add the ios platform.
Also, here are some other tips. https://github.com/phonegap/ios-sim/issues/67


#5

Use the command mentioned in following link to launch ios-sim:

Eg:
ios-sim launch platforms/ios/build/emulator/App\ Name.app --devicetypeid “com.apple.CoreSimulator.SimDeviceType.iPhone-6, 8.0”


#6

Ok, I’ve discovered something but I’m not sure where to go from here.

To troubleshoot, I started a new ionic project:

ionic start test tabs

I am using Auth0 in my project so I installed auth0-angular using:

bower install auth0-angular --save

Then added the scripts

Build/emulate work fine through this step.

Continuing to follow the directions on Auth0, I added the inappbrowser plugin using:

ionic plugin add org.apache.cordova.inappbrowser

Once I add this plugin and tried to rebuild, I get the error:

The following build commands failed:
CompileC build/test.build/Debug-iphonesimulator/test.build/Objects-normal/i386/CDVInAppBrowser.o test/Plugins/org.apache.cordova.inappbrowser/CDVInAppBrowser.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: /Users/piet/Sites/test/platforms/ios/cordova/build: Command failed with exit code 65
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Any thoughts on this?

P.S. I tried running "ios-sim launch platforms/ios/build/emulator/mobile.app --devicetypeid “com.apple.CoreSimulator.SimDeviceType.iPhone-6, 8.0” but I still got the same timeout error as before.


#7

hi,

you need to

  • remove plugin
  • remove ios platform
  • re-install plugin
  • end then re-install add ios platform
    after what, you can build

best,