xcode 应用程序归档是否有任何自动 Testflight 上传脚本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15496266/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:00:45  来源:igfitidea点击:

Is there any automatic Testflight upload script on application archiving?

iosxcodexcode4testflight

提问by Roman Truba

I found that Testflight is supporting application uploading through API call http://testflightapp.com/api/builds.format. It accepts application package, dsyms, application info and other.

我发现 Testflight 支持通过 API 调用上传应用程序http://testflightapp.com/api/builds.format。它接受应用程序包、dsyms、应用程序信息等。

So my question is next: Is there any automatic script for xcode which will upload build into Testflight after "archive" operation? Share the links, please.

所以我接下来的问题是:xcode 是否有任何自动脚本可以在“归档”操作后将构建上传到 Testflight 中?请分享链接。

SOLUTION IS HERE (Mac OS X 10.8):

解决方案在这里(Mac OS X 10.8):

1) Follow this manualand setup post-execution script

1) 按照本手册设置执行后脚本

2) Remove Replace "echo" strings with next rule:

2) 删除用下一条规则替换“echo”字符串:

#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#

API_TOKEN="<YOUR-TESTFLIGHT-API-TOKEN>"
TEAM_TOKEN="<YOUR-TESTFLIGHT-TEAM-TOKEN>"
SIGNING_IDENTITY="iPhone Developer"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/<YOUR-PROFILE-NAME>.mobileprovision"
LOG="/tmp/testflight.log"
GROWL="/usr/bin/terminal-notifier -title Xcode -message"

DATE=$( /bin/date +"%Y-%m-%d" )
ARCHIVE=$( /bin/ls -t "${HOME}/Library/Developer/Xcode/Archives/${DATE}" | /usr/bin/grep xcarchive | /usr/bin/sed -n 1p )
DSYM="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/dSYMs/${PRODUCT_NAME}.app.dSYM"
APP="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/Products/Applications/${PRODUCT_NAME}.app"

#/usr/bin/open -a /Applications/Utilities/Console.app $LOG

#echo -n "Creating .ipa for ${PRODUCT_NAME}... " > $LOG
${GROWL} "Creating .ipa for ${PRODUCT_NAME}"

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

#echo "done." >> $LOG
${GROWL} "Created .ipa for ${PRODUCT_NAME}"

#echo -n "Zipping .dSYM for ${PRODUCT_NAME}..." >> $LOG
${GROWL} "Zipping .dSYM for ${PRODUCT_NAME}"

/bin/rm "/tmp/${PRODUCT_NAME}.dSYM.zip"
/usr/bin/zip -r "/tmp/${PRODUCT_NAME}.dSYM.zip" "${DSYM}"

#echo "done." >> $LOG
${GROWL} "Created .dSYM for ${PRODUCT_NAME}"

#echo -n "Uploading to TestFlight... " >> $LOG
${GROWL} "Uploading to TestFlight"

/usr/bin/curl "http://testflightapp.com/api/builds.json" \
-F file=@"/tmp/${PRODUCT_NAME}.ipa" \
-F dsym=@"/tmp/${PRODUCT_NAME}.dSYM.zip" \
-F api_token="${API_TOKEN}" \
-F team_token="${TEAM_TOKEN}" \
-F notes="Build uploaded automatically from Xcode."

#echo "done." >> $LOG
${GROWL} "Uploaded to TestFlight"
/usr/bin/open "https://testflightapp.com/dashboard/builds/"

3) Reveal provision profile in finder: go to Organazier/Devices/Provision profiles, then right mouse on your profile, and click "Reveal in finder". Copy profile name and paste to PROVISIONING_PROFILE variable instead of <YOUR-PROFILE-NAME>

3) 在查找器中显示配置文件:转到组织器/设备/配置文件,然后在您的配置文件上右键单击,然后单击“在查找器中显示”。复制配置文件名称并粘贴到 PROVISIONING_PROFILE 变量而不是<YOUR-PROFILE-NAME>

4) Open terminal and install terminal-notifier:

4)打开终端并安装终端通知程序

sudo gem install terminal-notifier

sudo gem install terminal-notifier

5) You're ready :)

5) 你准备好了:)

采纳答案by Miles

I've also created a ruby gem for this if you want to integrate this into rake tasks:

如果您想将其集成到 rake 任务中,我还为此创建了一个 ruby​​ gem:

gem install testflight_upload

gem install testflight_upload

source on my github here

我的 github上的源代码在这里

回答by Bach

Here's a nice collection of utilities http://nomad-cli.com/

这是一个很好的实用程序集合http://nomad-cli.com/

I ended up using Shenzen to automate builds and testflight deployments.

我最终使用深圳来自动化构建和测试飞行部署。

回答by KrauseFx

Shenzhen is discontinued, you can use pilotinstead. It's a Ruby based tool to upload new builds and manage your beta testers. Under the hood it uses the iTunes Transporter and spaceship.

深圳停产了,可以用pilot代替。这是一个基于 Ruby 的工具,用于上传新构建和管理您的 Beta 测试人员。在幕后,它使用 iTunes Transporter 和spaceship