No matter what I try I can't get access to the Xcode simulators from my ionic/cordova project. Xcode Command Line Tool is installed.
cordova run ios --list
returns
Available ios devices:
Available ios virtual devices:
ionic cordova emulate ios --list
returns
Available ios virtual devices:
I have all the simulators in Xcode and it's working fine when Im opening the project in Xcode and run the simulators manually.
The consequences of this is that I cant run my app with livereload from the terminal:
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1"
returns
Device id for device name "iPhone X" and runtime "iOS 12.1" could not be found, or is not available.
This is a bug related to the new version of XCode. I had the same problem. I would advise you to uninstall and reinstall XCode but I don't think it will work.
I solved (dirty fix) my problem by applying what ejerskov says here: https://github.com/ios-control/ios-sim/issues/246
On platforms/ios/cordova/node_modules/ios-sim/src/lib.js
I have changed
available_runtimes[ runtime.name ] = (runtime.availability === '(available)');
to
available_runtimes[ runtime.identifier ] = (runtime.availability === '(available)');
Otherwise I think we should wait for a new release of ios-sim and cordova-ios...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With