Issues starting iOS simulator from CLI


#1

I am unable to start the app into the simulator from the command line. I can start the simulator from the xcode project manually but live-reload is not working in that case. Help would be greatly appreciated or pointers to a solution, there seems to be other people running into the problem, but no clear resolution available on the net.

➜  ionic cordova run ios
** BUILD SUCCEEDED **
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
[ERROR] An error occurred while running cordova run ios (exit code 1).
➜  ionic info

cli packages: (/Users/david/.nvm/versions/node/v8.6.0/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-deploy : 1.9.2
    ios-sim    : 6.1.2
    Node       : v8.6.0
    npm        : 5.3.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.0 Build version 9A235

Misc:

    backend : legacy

#2

After a bit more digging around, I found the solution to the problem

cd platforms/ios/cordova && npm install ios-sim@latest

#3

This worked for me. Thank you very much!

Further reference: Cordova iOS 4.5.1.


#4

Thanks a lot @berbsd :clap::clap::clap:


#5

But error occurred
Imacs-AMIT:cordova AMIT$ ionic cordova emulate ios
[WARN] Detected @ionic/cli-plugin-cordova in your package.json.

   As of CLI 3.8, it is no longer needed. You can uninstall it:
   
   npm uninstall -D @ionic/cli-plugin-cordova

[WARN] Detected @ionic/cli-plugin-ionic-angular in your package.json.

   As of CLI 3.8, it is no longer needed. You can uninstall it:
   
   npm uninstall -D @ionic/cli-plugin-ionic-angular

Running app-scripts build: --platform ios --target cordova
[13:08:33] build dev started …
Error: tsconfig: Cannot read file β€˜/Users/imac/Desktop/codedamn/tutorials/helloworld/platforms/ios/cordova/tsconfig.json’: ENOENT: no such file or directory, open β€˜/Users/imac/Desktop/codedamn/tutorials/helloworld/platforms/ios/cordova/tsconfig.json’.
at new BuildError (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at getTsConfig (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:313:15)
at Object. (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:298:46)
at step (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:32:23)
at Object.next (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:13:53)
at /Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:7:71
at Promise ()
at __awaiter (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:3:12)
at Object.getTsConfigAsync (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/transpile.js:295:12)
at Object.validateRequiredFilesExist (/Users/imac/Desktop/codedamn/tutorials/helloworld/node_modules/@ionic/app-scripts/dist/build/util.js:89:21)


#6

@berbsd This fixed it for me! Thank you so much!