关于持续集成:Xcode 7 Bots Fastlane:如何使用Fastlane的Deliver自动将应用程序部署到iTunes连接

Xcode 7 + Bots + Fastlane: How to automatically deploy an app to itunes connect using Fastlane's Deliver

问题:如何使用Deliver从运行在Xcode 7和Server 4.1上的Bot将IPA上传到itunesconnect?

我已经能够在Xcode 6.4,使用机器人的Server 4.1和Deliver(通过fastlane)中建立持续集成解决方案。一旦我升级到Xcode 7 beta-3,我的机器人就停止工作了。

这是我对Xcode 6.4所做的简要概述:

  • 在Bot Setting
  • 中选择\\\\"执行存档操作\\\\",来自发布触发器: echo gem install --user-install deliver#运行以安装Gem
  • 从发布触发器:echo export PATH=$PATH:/var/_xcsbuildd/.gem/ruby/2.0.0/bin#运行以将宝石添加到路径
  • 从发布触发器:

    1
    2
    3
    echo `DELIVER_PASSWORD="Password"
    /var/_xcsbuildd/.gem/ruby/2.0.0/bin/deliver testflight
    "${IPA_PATH}" -a 101233338 -u [email protected] --beta`
  • 一切正常,每次集成后,内部版本都上传到itunesconnect。

    升级到Xcode 7后,我不再能够使用Deliver上传到itunesconnect。这是我的Xcode 7工作流程:

  • 测试通过
  • 存档成功
  • 发布触发器1:成功构建IPA(使用来自此苹果开发人员的推荐)

    1
    2
    3
    4
    5
    6
    7
    8
     xcrun xcodebuild -exportArchive -archivePath
     $XCS_ARCHIVE -exportPath $XCS_ARCHIVE
     -exportOptionsPlist /Library/Developer/XcodeServer/ExportOptions.plist
     -IDEPostProgressNotifications=YES
     -DVTAllowServerCertificates=YES
     -DVTSigningCertificateSourceLogLevel=3
     -DVTSigningCertificateManagerLogLevel=3
     -DTDKProvisioningProfileExtraSearchPaths=/Library/Developer/XcodeServer/ProvisioningProfiles
  • 尝试通过传送上载IPA:

    1
    2
    3
    echo `DELIVER_PASSWORD="Password"
    /var/_xcsbuildd/.gem/ruby/2.0.0/bin/deliver testflight
    "${IPA_PATH}" -a 101233338 -u [email protected] --beta`
  • 结果:生成服务问题:终止xcodebuild,因为它长时间没有产生任何输出。 enter

    1
    2
    3
    4
    5
    6
    ESC[37m[12:03:08]: ESC[0mESC[32mReady to upload new build to TestFlight (CiTest - 1018099468)ESC[0m
    ESC[37m[12:03:08]: ESC[0mUploading ipa file to iTunesConnect
    ESC[37m[12:03:08]: ESC[0mGoing to upload updated app to iTunesConnect
    ESC[37m[12:03:08]: ESC[0mESC[32mThis might take a few minutes, please don't interrupt the scriptESC[0m
    ESC[37m[12:03:08]: ESC[0mESC[32mWaiting for iTunes Connect transporter to be finished.ESC[0m
    ESC[37m[12:03:08]: ESC[0mESC[32miTunes Transporter progress... this might take a few minutes...ESC[0m

    这仅仅是xcode服务器在交付完成之前逃脱了该过程。

    跟进:其他人是否遇到过此问题或类似问题?


    我在Apple开发者论坛上找到了该线程:https://forums.developer.apple.com/thread/9812

    以防万一您无法打开它。有人说

    It seems that Xcode bot trigger scripts have a 10 second timeout - which is far too short to do any useful work. I can replicate this by adding a"Before Integration" trigger containing nothing but a call to"sleep 10". When the integration runs, it fails with the error"terminated xcodebuild since it produced no output for too long".

    可能的临时解决方案可能是

    make sure you produce some output when your longer running task is running? Not a fix, but might be a workaround.

    ,人们回答了

    I have done this and the error no longer occurs. I was using a bash script and needed to echo the output from time to time to workaround this issue.

    希望这会有所帮助。