Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode : Generating an automatic comment upon Archive

Context : My project contains two backend servers, one for development and one for production. Each time I make a build for QA, I'll need to put which server the build is on on TestFlight (this is ok). But on my archive list on Xcode, I easily get more than 100 archives where I have to put manually if it was prod or dev server.

The main issue here is when the QA needs to rollback to a specific version on a specific server.

Question : Is there an automatic way to put a comment on the archive upon building ? I would like to put something like :

[Build Number] - [Dev|Live] Server

Thanks

like image 971
Charles Vu Avatar asked May 31 '12 10:05

Charles Vu


2 Answers

We use the following command to add a comment to the archive directly after the build (xcodebuild):

/usr/libexec/PlistBuddy -c "Add :Comment string \"your comment goes here\"" "$ARCHIVE_DIR/Info.plist"

with $ARCHIVE_DIR being the directory to the archive in question, e. g.:

ARCHIVE_DIR=`ls -dt1 $HOME/Library/Developer/Xcode/Archives/*/*.xcarchive |head -n1`
like image 166
Norman Lahme-Hütig Avatar answered Sep 26 '22 04:09

Norman Lahme-Hütig


I tried Norman's idea but couldn't get the syntax to work. In the end I used:

ARCHIVE_DIR=$(ls -dt1 $HOME/Library/Developer/Xcode/Archives/*/*.xcarchive/Info.plist |head -n1)
/usr/libexec/PlistBuddy -c "Add :Comment string \"your comment goes here\"" "$ARCHIVE_DIR"
like image 20
Daz Eddy Avatar answered Sep 25 '22 04:09

Daz Eddy