ios - 如何为工作区设置 Jenkins Xcode 插件?
问题描述
我对 iOS 应用程序开发领域很陌生。我需要在 Jenkins 中为我构建的新 Swift 应用程序设置构建。作为其中的一部分,我使用 Cocoapods 来管理依赖项,这反过来意味着我现在有了一个工作区,而不是一个简单的项目。
我现在正在尝试将此应用程序构建为我们管道的一部分并遇到以下错误:
FATAL: Since there are multiple projects in the workspace, you must be specify the location of the target project as Xcode Project File.
Build step 'Xcode' marked build as failure
Finished: FAILURE
我的项目的根如下所示:
$ ls -la
total 32
drwxr-xr-x 14 mcbint staff 448 15 Jan 15:16 .
drwxr-xr-x 3 mcbint staff 96 15 Jan 14:33 ..
drwxr-xr-x 13 mcbint staff 416 16 Jan 11:11 .git
-rw-r--r-- 1 mcbint staff 108 15 Jan 14:56 .gitignore
-rw-r--r-- 1 mcbint staff 501 15 Jan 14:56 Podfile
-rw-r--r-- 1 mcbint staff 379 15 Jan 14:56 Podfile.lock
drwxr-xr-x 9 mcbint staff 288 15 Jan 15:16 Pods
-rw-r--r-- 1 mcbint staff 666 15 Jan 14:56 README.md
drwxr-xr-x 10 mcbint staff 320 15 Jan 14:56 mcb-phoneagent-ios
drwxr-xr-x 5 mcbint staff 160 15 Jan 15:16 mcb-phoneagent-ios.xcodeproj
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-ios.xcworkspace
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-iosTests
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-iosUITests
drwxr-xr-x 2 mcbint staff 64 15 Jan 15:07 test-reports
在我的开发机器上,我可以使用以下命令成功构建应用程序:
xcodebuild -workspace mcb-phoneagent-ios.xcworkspace -scheme mcb-phoneagent-ios
有人看到我设置不正确的东西吗?
解决方案
当我遇到这个问题时,这就是我解决这个问题的方法:
确保您将方案容器设置为工作区(而不是项目。这可以在 Xcode 中的 Product -> Scheme -> Manage Schemes 中检查,然后查看标题为“Container”的列)
确认 xcshareddata 位于 Jenkins 正在使用的工作区目录中。
在该框中填写您要用于作为 Xcode 工作区文件输入的给定工作区的 xcsheme 文件的名称(在您的情况下,我猜它是 mcb-phoneagent-ios)。
推荐阅读
- node.js - extraHeaders 在 socket.io-client 中不起作用
- ios - IBM MobileFirst 7.0 - libstdc++.6.dylib 上的 Xcode 10.1/iOS 12 问题
- node.js - 从 Vue 组件向 NodeJs 服务器进行异步调用并等待应答
- html - 为图像添加底部和右侧边框
- javascript - 如何仅在反应状态发生突变后才进行axios调用?
- windows - ImageMagick 没有此图像格式“PDF”的解码委托 Windows
- go - 为什么 unmarshal 在 golang 中改变对象的类型
- twitter-bootstrap - 具有对齐中心列的三列行
- javascript - 从 Nuxt 配置文件提供资产
- javascript - 在解析 HTML 之前等待脚本结束