1

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.

Community
  • 1
  • 1
  • Sounds like a problem with your deivce have you enabled usb debuging? what does cmd -`adb devices` say ? – Ira Watt Apr 05 '19 at 13:38
  • I've never plugged in my device to develop my app. It always started an emulation via xcode when running ``ionic cordova run ios -lc`` adb devices will return me probably nothing, as no phone is connected –  Apr 05 '19 at 13:41
  • you have tried this command : `ionic emulate ios --target="iPhone 6 Plus, 8.2" ` – IftekharDani Apr 11 '19 at 08:32
  • reference link : `https://github.com/ionic-team/ionic-cli/issues/317` , `https://github.com/ionic-team/ionic-cli/issues/2487` – IftekharDani Apr 11 '19 at 08:33
  • I did right now. First, it said that this command had been changed so I started it with ``ionic cordova emulate ios --livereload``. Doing so, I get the exact same error message as in my question above –  Apr 11 '19 at 08:36
  • >The emulate command has been renamed. To find out more, run: –  Apr 11 '19 at 08:37

2 Answers2

2

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"
Anuj Panwar
  • 683
  • 7
  • 10
1

Do the following:

cd platforms/ios/cordova && npm install ios-sim@latest
cd ../../../
cordova platform rm ios
cordova platform add ios@4.5.0
ionic cordova emulate ios --target --list
ionic cordova plugin rm cordova-plugin-console

That should do it.

Tachyon
  • 2,171
  • 3
  • 22
  • 46
  • Unfortunately, your answer didn't help me. Nevertheless, I really appreciate your help! Thank you. –  Apr 11 '19 at 10:35