框架项目仅构建设备不能用于运行此目标

时间:2016-03-26 15:41:01

标签: swift continuous-integration xcode7 travis-ci

它是一个仅限框架项目(SWIFT),它构建一个库(.framework模块),以便与项目链接以及单元测试,并最终导致以下错误。

** BUILD SUCCEEDED **
xcodebuild: error: Failed to build project HelloWorld with scheme HelloWorld.
    Reason: A build only device cannot be used to run this target.
The command "xcodebuild clean build test -project HelloWorld.xcodeproj -scheme HelloWorld CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO" exited with 70.

我的travis yml文件是

language: objective-c

branches:
 only:
 - master

xcode_project: HelloWorld.xcodeproj
xcode_scheme: HelloWorld
osx_image: xcode7.2 

script:
- xcodebuild clean build test -project HelloWorld.xcodeproj -scheme HelloWorld CODE_SIGN_IDENTITY=""
  CODE_SIGNING_REQUIRED=NO

1 个答案:

答案 0 :(得分:2)

对于Xcode 7.2

尝试添加 -destination' platform = iOS模拟器,名称= iPhone 6,操作系统= 9.0'

脚本: - xcodebuild clean build test -project HelloWorld.xcodeproj -scheme HelloWorld CODE_SIGN_IDENTITY =""   CODE_SIGNING_REQUIRED = NO -destination' platform = iOS模拟器,名称= iPhone 6,操作系统= 9.0'