• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 使用 Jenkins 对 iOS 进行单元测试

[复制链接]
菜鸟教程小白 发表于 2022-12-12 12:17:07 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我正在尝试使用 jenkins 自动化我的 iOS 项目。 但是,我想用 jenkins 测试的项目遇到问题。

该项目名为 ttt 并使用 cocoapods,因此它也有一个名为 ttt 的工作区。

查看项目中存在的以下方案。 enter image description here

我关注了this教程。

我所做的设置如下 enter image description here

enter image description here

enter image description here

当我尝试运行它时,它会卡在这里!

Going to invoke xcodebuild:, scheme: ttt, sdk: DEFAULT, workspace: ttt, configuration: Debug, clean: NO, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT
[lbp-iOS] $ /usr/bin/xcodebuild -scheme ttt -workspace ttt.xcworkspace -configuration Debug build test -destination "platform=iOS Simulator,name=iPhone 6,OS=10.1"

当我从工作区字段中删除 ttt 时,我收到以下错误

Going to invoke xcodebuild:, scheme: ttt, sdk: DEFAULT, project: DEFAULT, configuration: Debug, clean: NO, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT
[lbp-iOS] $ /usr/bin/xcodebuild -scheme ttt -configuration Debug build
xcodebuild: error: The project named "ttt" does not contain a scheme named "ttt". The "-list" option can be used to find the names of the schemes in the project.
Build step 'Xcode' marked build as failure
Recording test results



Best Answer-推荐答案


好吧,为什么它不起作用与该方案实际上并未发送到 git 的事实有关。 您需要在 xcode 项目中指定它,否则它甚至不会显示为您可以提交的文件。

为此,请转到 xcode > Product > Scheme > Manage Schemes
您将看到一个屏幕,其中包含项目中的所有方案,请确保勾选 Shared 下的框,以获取您想在 Jenkins 中使用的所有方案。

enter image description here

将此推送到您的 git 并重试。它现在应该可以工作了。

关于ios - 使用 Jenkins 对 iOS 进行单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40536087/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap