18

The version of the iOS app I submitted to iTunes Connect for Testflight beta testing is almost expired. AFAIK in order to extend the 30-days trial period I need to submit it again but with an incremented build version. Since the code base I archived is long time ago and I do not want to revert the code base to that version and archive it again. I just wonder if there is any possible way to change the build number of an archived iOS project. I would like to submit version 1.3.6 (1.3.6.8, which is already in iTunes Connect for beta testing) again as shown below.

enter image description here

chubao
  • 5,871
  • 6
  • 39
  • 64

1 Answers1

42

If you still have the original archive then of course. An Xcode Archive is just a directory, with a specific hierarchy.

You should just

  1. Open the Xcode Organizer - the one on the screenshot in your question
  2. Right click on the version you want to modify
  3. Select "Show in Finder"
  4. Right click on the archive "file" (something like: "ProjectName 9-8-15, 7.34 AM.xcarchive")
  5. Choose "Show Package Contents"

You should use a search tool to scan through the folders to find the version number in every file. For a basic iOS app it's enough to modify two files: Info.plist and dSYMs/YourProjectName.app.dSYM/Contents/Info.plist.

You're done at this point, but the organizer does not pick up the changes. You can just duplicate the whole .xcarchive file/folder and change the date with like one minute. Re-open the Organizer and you'll have your new version there.

Actually, you should probably just leave the original .xcarchive as it is and start with duplicating it before opening with "Show Package Contents".

Viktor Benei
  • 3,447
  • 2
  • 28
  • 37
  • 18
    You also need to edit the version number in `Products/Applications/YourProjectName.app/Info.plist` – William Grand Oct 27 '17 at 19:56
  • Worth noting that the key you are looking for in the .plist files is 'CFBundleVersion' for the top-level info.plist and the dSYMs/ version, and then is 'Bundle Version' in the Products/ plist that William Grand alludes to above. In order to get to these, remember to right click -> show package contents rather than try to navigate downwards (or just use terminal) – DanWebster Jun 26 '19 at 18:22
  • 8
    The amount of times I've done an archive, realised I forgot to bump the number, groaned and then re-archived is comically high. However, this method doesn't really make it any faster! I'll probably just stick to re-archiving – Matt Fletcher Dec 05 '19 at 13:12
  • 2
    I'm surprised no1 made a script for this yet – João Serra Aug 17 '21 at 15:24
  • where is the applications folder? @WilliamGrand – DCodes Dec 06 '21 at 18:30
  • The Applications folder is under`/Users/{your username}/Library/Developer/Xcode/Archives/{your archive date}/{xcarchive file}/Products/Applications` – William Grand Dec 07 '21 at 19:42
  • What @DanWebster said. This is the kind of thing that drives Devs crazy the world over, and Apple could fix in less than a single hour. It's astouding to me that this problem has persisted for so long. I think Apple needs to actually spend some time with Devs, and maybe look over their shoulder and just answer questions until they are blue in the face. Pay me well enough to do it, and I'll happily do it. It would certainly make devs a lot happier and a LOT more productive, which is beneficial to Apple. – John Pitts Aug 17 '23 at 18:30
  • Also, the above method is difficult to execute. Tried it, and two files came back in the search, and no idea how to edit them to change the number. – John Pitts Aug 17 '23 at 18:38