【问题标题】:xcodebuild: error: Failed to build workspace. Reason: A build only device cannot be used to run this targetxcodebuild:错误:无法构建工作区。原因:无法使用仅构建设备来运行此目标
【发布时间】:2017-07-24 23:00:35
【问题描述】:

我正在尝试使用命令行在设备 (iPhone) 上构建和测试:

xcodebuild  \
    -workspace MyApp.xcworkspace \
    -scheme MyApp \
    -destination 'generic/platform=iOS,id=iPhoneUUID' \
    clean test

但我收到此错误:

xcodebuild: error: Failed to build workspace MyApp with scheme MyApp.
    Reason: A build only device cannot be used to run this target.

你们中的任何人都知道我为什么会收到这个错误吗?

我将非常感谢任何帮助。

【问题讨论】:

  • 你试过这个post
  • 你让它工作了吗?
  • @SvenDriemecker,是的,谢谢你的帮助

标签: ios swift3 xcode8 xcodebuild


【解决方案1】:

切断generic 值中的-destination 部分。否则 Xcode 不会尝试为您的设备构建,而是为通用构建设备:

xcodebuild  \
    -workspace MyApp.xcworkspace \
    -scheme MyApp \
    -destination 'platform=iOS,id=iPhoneUUID' \
    clean test

【讨论】:

    猜你喜欢
    • 2014-02-01
    • 1970-01-01
    • 2016-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-02
    相关资源
    最近更新 更多