ionic-frameworkionic4ionic-cli

Ionic v4: "Ionic cordova run -l" won't start my app


Additional notes for upcoming viewers This seems to be a common problem on macOS: https://github.com/ios-control/ios-sim/issues/253

Temporary solution below this question.

I've worked on a fresh ionic project a few days ago and I had no problems back then whatsoever.

Today I tried to start the development server: ionic cordova run -l but then I got this error message:

No target specified for emulator. Deploying to undefined simulator

Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.

An error occurred while running subprocess cordova.

Logging currently available devices(ionic cordova run --list) gives me this output:

Available ios devices:

Available ios virtual devices:

It is empty. None devices are available. Not for ios and neither for android.

Ionic version: 4.12.0

Cordova version: 9.0.0

Nodejs version: 11.5.0

I would appreciate any help to make this work again.


Solution

  • Seems like you have upgraded the Mac OS, faced similar problem in past and updating and re-installing iOS-sim was not of much help.

    For me following command worked without installing anything further

    ionic cordova emulate ios --livereload --consolelogs --target="iPhone-6,com.apple.CoreSimulator.SimRuntime.iOS-12-2"
    

    Also, you can try this one if above don't work

    ionic cordova emulate ios --livereload --consolelogs --target="iPhone-6,com.apple.CoreSimulator.SimRuntime.iOS-12-2" --buildFlag="-UseModernBuildSystem=0"