简体   繁体   English

如何从Xcode Bot向TestFlight部署自动构建?

[英]How do I deploy automated builds to TestFlight from an Xcode Bot?

I spent a good amount of time formatting the mentioned blog with code, screenshots, and etc. that is too much effort to duplicate here on Stack Overflow. 我花了很多时间使用代码,屏幕截图等格式化所提到的博客,这是在Stack Overflow上复制的过多努力。 That said I figured the community would want some help in this arena (I struggled for a long time figuring it all out), so I posted this question and respective answer. 那说我认为社区会在这个领域需要一些帮助(我很长时间都在努力搞清楚),所以我发布了这个问题和各自的答案。 If you still think that the intent of this post is nefarious, please comment as such and I'll delete it! 如果你仍然认为这篇文章的意图是邪恶的,请这样评论,我会删除它!

The question is: how do I configure my fancy new Xcode server with Bots to continuously integrate and send completed builds to my testers via test flight? 问题是:如何使用Bots配置我喜欢的新Xcode服务器,以便通过测试飞行不断地集成并将完成的构建发送给我的测试人员? To me, this seems like the holy grail of CI in the iOS world, so I spent a lot of time to figure it out. 对我而言,这似乎是iOS世界中CI的圣杯,所以我花了很多时间来弄明白。

The process involves some manual work that just doesn't seem to get done properly by the XCode server software in Mavericks, at least in the initial release. 该过程涉及一些手动工作,这些工作似乎没有通过Mavericks中的XCode服务器软件正确完成,至少在初始版本中是这样。 It took me a lot of time and even some scripting to figure it all out and make it work, and I'm happy to share the results. 我花了很多时间甚至一些脚本来弄清楚这一切并让它发挥作用,我很乐意分享结果。

For the sake of adding value to this question, I've posted the post-op script that you should run during the Archive process below. 为了增加这个问题的价值,我发布了你应该在下面的归档过程中运行的操作后脚本。 The link to my blog below provides step by step details should you need more information. 如果您需要更多信息,下面我的博客链接提供了一步一步的详细信息。

#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Valid and working as of 10/29/2013
# Xcode 5.0.1, XCode Server 
#
API_TOKEN="<Your TesFlight API Token>"
TEAM_TOKEN="<Your TestFlight Team Token>"
DISTRIBUTION_LISTS="<Comma separated TestFlight Distribution List Names for auto deploy>"
PROVISIONING_PROFILE="/Library/Server/Xcode/Data/ProvisioningProfiles/<your file name here>.mobileprovision"
#EXAMPLE:"/Library/Server/Xcode/Data/ProvisioningProfiles/DocLink_InHouse_2013.mobileprovision"

SIGNING_IDENTITY="<your provisioning profile name here>"
#EXAMPLE:"iPhone Distribution: Unwired Revolution, LLC."

# DO NOT EDIT BELOW HERE!
########################################
DSYM="/tmp/Archive.xcarchive/dSYMs/${PRODUCT_NAME}.app.dSYM"

IPA="/tmp/${PRODUCT_NAME}.ipa"

APP="/tmp/Archive.xcarchive/Products/Applications/${PRODUCT_NAME}.app"

# Clear out any old copies of the Archive
echo "Removing old Archive files from /tmp...";
/bin/rm -rf /tmp/Archive.xcarchive*

#Copy over the latest build the bot just created
echo "Copying latest Archive to /tmp/...";
LATESTBUILD=$(ls -1rt /Library/Server/Xcode/Data/BotRuns | tail -1)
/bin/cp -Rp "/Library/Server/Xcode/Data/BotRuns/${LATESTBUILD}/output/Archive.xcarchive" "/tmp/"

echo "Creating .ipa for ${PRODUCT_NAME}"
/bin/rm "${IPA}"
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${IPA}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}"

echo "Done with IPA creation."

echo "Zipping .dSYM for ${PRODUCT_NAME}"
/bin/rm "${DSYM}.zip"
/usr/bin/zip -r "${DSYM}.zip" "${DSYM}"

echo "Created .dSYM for ${PRODUCT_NAME}"

echo "*** Uploading ${PRODUCT_NAME} to TestFlight ***"
/usr/bin/curl "http://testflightapp.com/api/builds.json" \
-F file=@"${IPA}" \
-F dsym=@"${DSYM}.zip" \
-F api_token="${API_TOKEN}" \
-F team_token="${TEAM_TOKEN}" \
-F distribution_lists="${DISTRIBUTION_LISTS}" \
-F notes="Build uploaded automatically from Xcode Server Bot."

echo "TestFlight upload finished!"

I hope all the time I spent on it will save the community collectively a lot more of theirs! 我希望我花在它上面的所有时间都会为社区集体拯救他们更多的东西!

Here is the link: http://matt.vlasach.com/xcode-bots-hosted-git-repositories-and-automated-testflight-builds/ 这是链接: http//matt.vlasach.com/xcode-bots-hosted-git-repositories-and-automated-testflight-builds/

Here is a link to a post that outlines how to create an Xcode bot, connected to a 3rd party git repository, with automated deployment of builds to TestFlight: 这是一个帖子的链接,其中概述了如何创建连接到第三方git存储库的Xcode机器人,并自动部署到TestFlight的构建:

http://matt.vlasach.com/xcode-bots-hosted-git-repositories-and-automated-testflight-builds/ http://matt.vlasach.com/xcode-bots-hosted-git-repositories-and-automated-testflight-builds/

Hope it helps! 希望能帮助到你! Please sound off with your comments or feedback. 请注意您的意见或反馈。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xcode 5 机器人和 Testflight 自动构建 - Xcode 5 bots and Testflight automated builds 如何在TestFlight(iTunes Connect)错误中修复此多个版本? - How do I fix this multiple builds in TestFlight (iTunes Connect) bug? Xcode提供了TestFlight应用程序的崩溃报告……但是我怎么读呢? - Xcode gives crash reports for TestFlight app… but how do I read it? 如何从 xcode 获取 TestFlight 应用程序的日志 - How can I get the log of a TestFlight app from xcode 如何从 Xcode 6.3 中的设备访问 TestFlight Beta 分布式应用程序的崩溃报告而不是 .ips.beta 文件? - How do I access crash reports instead of .ips.beta files for a TestFlight Beta-distributed app from device in Xcode 6.3? 我如何更改通过testflight发送构建的电子邮件地址 - How can i change the email address for sending builds via testflight 用于TestFlight的Xcode上传-我需要分发配置概要文件吗? - Xcode upload for TestFlight - do I need a distribution provisioning profile? 我是否必须做一些特别的事情才能让 TestFlight 构建使用我的通知扩展目标? 它被忽略 - Do I have to do something special to have TestFlight builds use my Notification Extension target? It's ignored 推送通知在TestFlight中不起作用,但在Xcode中起作用 - Push notifications won't work in TestFlight, but do work from Xcode 更改从TestFlight发送的自动电子邮件中的文本 - Changing text in automated email sent from TestFlight
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM