This problem is caused because Xcode 10 contains a new build system which is currently not compatible with cordova-ios@4
- see here.
The solution for now is to run Cordova with the --buildFlag='-UseModernBuildSystem=0'
option to instruct Xcode to use the old build system, e.g.:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
Update: For my own convenience, I've wrapped this in a shell script:
#!/bin/bash
# Adds build flag to make cordova-ios@4 work with Xcode 10
cordova "$@" --buildFlag='-UseModernBuildSystem=0'
I saved this in a file called cordova-xcode10
, made sure it's in the path and made it executable (chmod a+x cordova-xcode10
), then I can just do:
cordova-xcode10 run ios --target "iPhone-8"
and it will work with Xcode 10
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…