gpt4 book ai didi

ios - 如何在 build.json 中指定 Cordova 构建目标

转载 作者:行者123 更新时间:2023-12-01 15:42:57 25 4
gpt4 key购买 nike

执行 cordova build 时出现错误.

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

  { platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }

由于我的应用程序仅构建在 iPad 上,我想我需要为 iPad 设置构建目标,但我不确定如何执行此操作。
版本
  • XCode:版本 11.1 (11A1027)
  • Cordova :cordova@9.0.0
  • MacOS:10.15 Catalina

  • 我的 config.xml 有这些标签来指定 iPad:
        <preference name="target-device" value="tablet" />
    <preference name="deployment-target" value="10.3" />
    完整的错误:
    Reading build config file:
    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/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/Sokketsu.xcworkspace
    Configuration: Debug
    Platform: emulator
    Target: iPhone 11 Pro Max
    Running command: xcodebuild -workspace Sokketsu.xcworkspace -scheme Sokketsu -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/sharedpch
    Build settings from command line:
    CONFIGURATION_BUILD_DIR = /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/emulator
    SDKROOT = iphonesimulator13.1
    SHARED_PRECOMPS_DIR = /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/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 }

    Available destinations for the "Sokketsu" scheme:
    { platform:iOS Simulator, id:B90FC025-F8EB-40B3-90C5-E9094C0FFD17, OS:13.1, name:iPad Air (3rd generation) }
    { platform:iOS Simulator, id:3131A6AD-3C4E-4CEA-8889-9C7E22EAF816, OS:13.1, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:A8055BC4-F95C-43FA-8B28-7FACBD3D57B6, OS:13.1, name:iPad Pro (11-inch) }
    { platform:iOS Simulator, id:7FAD7B1C-70DD-407A-AC99-3ACAD2670726, OS:13.1, name:iPad Pro (12.9-inch) (3rd generation) }

    Ineligible destinations for the "Sokketsu" 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

    最佳答案

    您需要设置 target-deviceuniversal然后在完成后在 Xcode 中将其改回平板电脑。

    配置文件

    <preference name="target-device" value="universal" />

    PS:这个问题可能是在运行cordova build ios命令时在cordova-ios 5.0.1版左右开始的。

    关于ios - 如何在 build.json 中指定 Cordova 构建目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58374192/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com