7

I had a bot that was working perfectly under Xcode 6.4. An after trigger script was automatically uploading the IPA using this path : "$XCS_OUTPUT_DIR/$XCS_PRODUCT"

However (even after redoing a bot from scratch) it appears that :

  • $XCS_PRODUCT is Always empty.
  • $XCS_OUTPUT_DIR is pointing to a folder that does not exist because after checking out on server it appears that Xcode server is storing .ipa there : /Library/Developer/XcodeServer/IntegrationAssets/

How to find my .ipa without this variable during my after trigger script?

Ganzolo
  • 1,394
  • 12
  • 23
  • I have exactly the same problem. The IPA isn't produced until my script stopped looking for it... – Mikael Sep 22 '15 at 13:48
  • 2
    I sent a bug report at Apple, someone marked it as a duplicate, let's hope this got fixed soon! :) – Ganzolo Sep 22 '15 at 20:01

1 Answers1

4

I had the same problem and after discussion on Apple Developer Forums I found out that there actually is .IPA file inside

/Library/Developer/XcodeServer/Integrations/Integration-INTEGRATION_ID/ExportedProduct/

directory and you can access it from After Trigger Script by using something like

originalBinaryName=$(basename "${XCS_ARCHIVE%.*}".ipa)
originalBinaryPath="${XCS_OUTPUT_DIR}/ExportedProduct/Apps/${originalBinaryName}"

I have also sent a bug report, because $XCS_PRODUCT should not be empty anyway, and it would be nice to have new environment variable for the complete path of .IPA file.

tadija
  • 2,981
  • 26
  • 37
  • I tried something similar, but it appears that all .ipa are generated after completion of "after trigger script". Have you tried your solution? Is it working? – Ganzolo Sep 25 '15 at 15:01
  • Yup, it's working now. IPA's are there when 'after trigger' is executed. – tadija Sep 25 '15 at 15:20
  • You can also check existance of files in terminal while integration is going on. Maybe you had wrong path to file or something. – tadija Sep 25 '15 at 15:21
  • My XCS_OUTPUT_DIR did not exist when I was trying it. So I tried with IntegrationAssets/ which wasn't generated. i will try ur solution! Thank! – Ganzolo Sep 25 '15 at 15:25
  • You're right about IntegrationAssets directory, it's created only after the integration is finished, so you'll have to see what's going on with your XCS_OUTPUT_DIR variable, mine was ok and this is how I got the IPA file name: by using XCS_ARCHIVE last path component and replacing extension (`originalBinaryName` in the example). – tadija Sep 25 '15 at 15:29
  • Excellent this works! Perfect work around before having official FIX – Ganzolo Sep 26 '15 at 19:02