Not able to emulate ios with Cordova

耗尽温柔 提交于 2019-12-08 11:56:00

问题


I'm going through the beginner series for a Cordova application. I installed XCode and created a new Cordova project. That being said, when I run cordova emulate ios, I get the following error:

No target specified for emulator. Deploying to iPhone-X, 12.1 simulator
/Users/osx/Code/cordova-poc/platforms/ios/build/emulator/HelloCordova.app/Info.plist file not found.

If I run cordova build ios and run the code in XCode, then I can see that Xcode opens up the emulator where I can see my changes. This is, obviously, too slow.


回答1:


I suspect that you're running XCode 10. XCode 10 has a new build system which is not yet supported by Cordova.

You should be able to work around this by running the following:

ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"

More information in this issue here: https://github.com/apache/cordova-ios/issues/407




回答2:


As stated

Xcode 10 uses a new build system by default (previously available on an opt-in basis in Xcode 9). The cordova-ios project structure is not compatible with this new build system and results in failures. Source

1 CLI WORKAROUND

# Cordova CLI
cordova run ios --buildFlag='-UseModernBuildSystem=0'
cordova build ios --buildFlag='-UseModernBuildSystem=0'

# Ionic CLI
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

2 CONFIG FILE WORKAROUND

"buildFlag": [
  "-UseModernBuildSystem=0"
]

In your build.json config file.

3 XCODE WORKAROUND Thanks to @kitolog for the screens.



来源:https://stackoverflow.com/questions/53090035/not-able-to-emulate-ios-with-cordova

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!