The other day, I was going through my xcode archive looking for a specific build, and I saw that they all looked the same! The question is pretty simple, but I haven't been able to find any way to do it. Basically, I want to add the build number to either the name description or comment (it doesnt really matter which one) of the archive so I can identify it later. Keep in mind that I don't want the version number which shows up after you click the archive. That wont work because I have incremental builds that are distributed on an ad-hoc network with testflight with the same version number, but different build numbers. For example, 2.0.8.10 and 2.0.8.11 both show up as 2.0.8. Any ideas?
Asked
Active
Viewed 664 times
1 Answers
1
What are you using to build your archives? Are you using the Xcode GUI via Product -> Archive? Or are you using some kind of build script that calls xcodebuild? If you're using the Xcode GUI, I'm not aware of any way to automate the name--you'll just have to copy in the full build number when you make the build.
If you're using a build script, check out PlistBuddy (ships with OSX, but by default isn't in your PATH, usually it's at /usr/libexec/PlistBuddy
). You can use PlistBuddy to read the build number from your target's Info.plist and then insert that value into the name/description of the archive you're building.

Idles
- 1,131
- 5
- 9
-
I am using the xcode gui. Do you think I could use PlistBuddy as a post-build action to modify the metadata of the archive that xcode created? – mrosales Jun 21 '13 at 18:42
-
Ah, interesting idea. I'm not sure what format the archive metadata is in, but you could definitely use PlistBuddy to extract the build # at that point in time... getting it into the archive metadata post-creation is another question. – Idles Jun 21 '13 at 19:08
-
It looks like it will work. I don't have time to write the script now, but I will update this thread with an answer when I do. I did "Show in finder" and then "Show Package Contents" and then edited the info.plist file and when I restarted xcode it showed up with my new comment. So if I edit that plist as a post build action I think it should work – mrosales Jun 21 '13 at 19:13