Ionic Cordova - xcodebuild: error: Unable to find a destination matching the provided destination specifier:

Ionic Cordova - xcodebuild: error: Unable to find a destination matching the provided destination specifier:

更新我的部署目标后出现上述错误(因为商店现在需要这个最低版本)

<preference name="deployment-target" value="14.0" />

这是与 相同的错误,但是我已经将 target-device 设置为 universal,而且我没有得到任何 Available destinations

离子信息是

       Ionic:

       Ionic CLI                     : 5.2.7 (/usr/local/lib/node_modules/ionic)
       Ionic Framework               : @ionic/angular 4.11.13
       @angular-devkit/build-angular : 0.802.2
       @angular-devkit/schematics    : 8.3.29
       @angular/cli                  : 8.2.2
       @ionic/angular-toolkit        : 2.3.3

    Cordova:

       Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
       Cordova Platforms : ios 5.1.1
       Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 14 other plugins)

    Utility:

       cordova-res : 0.14.0 (update available: 0.15.3)
       native-run  : not installed

    System:

       Android SDK Tools : 26.1.1 (/Users/Development/.android-sdk-macosx/)
       ios-deploy        : 1.9.4
       ios-sim           : 8.0.2
       NodeJS            : v12.18.0 (/usr/local/bin/node)
       npm               : 7.11.2
       OS                : macOS Catalina
       Xcode             : Xcode 11.4 Build version 11E146

我的build.json是

完整的错误输出是

cordova build ios --release --buildConfig platform_build_files/ios/build.json
Reading build config file: /Users/Development/dev/myProductSuite/myApp/platform_build_files/ios/build.json
No simulator found for ". Falling back to the default target.
Building for "iPhone 11 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max, iPhone-11-Pro-Max).
Building project: /Users/Development/dev/myProductSuite/myApp/platforms/ios/MyApp.xcworkspace
        Configuration: Release
        Platform: emulator
        Target: iPhone 11 Pro Max
Adding xcodebuildArg: EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
Adding xcodebuildArg: ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO
Adding xcodebuildArg: LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"
Running command: xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Release -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/Development/dev/myProductSuite/myApp/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/Development/dev/myProductSuite/myApp/platforms/ios/build/sharedpch EMBEDDED_CONTENT_CONTAINS_SWIFT = YES ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace "MyApp.xcworkspace" -scheme "MyApp" -configuration Release -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 11 Pro Max" build CONFIGURATION_BUILD_DIR=/Users/Development/dev/myProductSuite/myApp/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/Development/dev/myProductSuite/myApp/platforms/ios/build/sharedpch "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES" ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""

Build settings from command line:
    ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
    CONFIGURATION_BUILD_DIR = /Users/Development/dev/myProductSuite/myApp/platforms/ios/build/emulator
    EMBEDDED_CONTENT_CONTAINS_SWIFT =  YES
    LD_RUNPATH_SEARCH_PATHS =  "@executable_path/Frameworks"
    SDKROOT = iphonesimulator13.4
    SHARED_PRECOMPS_DIR = /Users/Development/dev/myProductSuite/myApp/platforms/ios/build/sharedpch

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
                { platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }

        Ineligible destinations for the "MyApp" scheme:
                { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
                { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
xcodebuild: Command failed with exit code 70
[ERROR] An error occurred while running subprocess cordova.

我已将我的项目放入一个新文件夹中,因此重新生成了 xcode 项目,但没有成功。

它在哪里选择这个目的地列表,我该如何解决这个问题?

您的虚拟机 Xcode 版本是 11.4。这仅支持 iOS 13.4,如下所示:https://developer.apple.com/documentation/xcode-release-notes/xcode-11_4-release-notes 因此,您的 iOS 14.0 部署目标高于模拟器的 OS 版本 iOS 13.4,这就是它们未显示的原因。我不熟悉 Ionic Cordova,但您需要找到一种在您的 VM 中使用 Xcode 12 或更高版本的方法。

我遇到了类似的问题。我敢肯定,造成这种情况的原因是我删除了所有模拟器。我遇到的修复是在 xcrun simctl

  1. 运行 xcrun simctl list --json 查看所有已知设备
  2. 运行 xcrun simctl delete unavailable(或者 xcrun simctl delete all 如果你想摆脱一切。
  3. 现在,您也许可以通过 设备和模拟器 菜单来完成此操作,但我想坚持使用 xc运行 来 创建一个新的模拟设备。通过键入命令 xcrun simctl create 您将获得用法。我使用了命令:

xcrun simctl create iPhone\ 12 "iPhone 12"