xcarchive to ipa using msbuild command line

1.7k views Asked by At

Premise: I have been limited to utilizing xamarin for the early stages of this project as an attempt to speed up the dev process for beta distribution. (spoiler: it's slow and poorly documented).

So I am creating a build pipeline for app store distribution and have given all the msbuild love I can give, but I can't seem to pull the last two pieces together.

Problem: In order to include desymbolication files for iphone distribution you must build an archive, and then utilize the archive to build a signed ipa to upload to Itunes Connect. I cannot seem to find the documentation to support specifying a built archive path to create an ipa with in msbuild.

Which one of you wizards can help me and this small abused xamarin community come up with an answer? Currently my steps would be as follows.

build the archive with the following: msbuild "iOS/project.sln" /p:Configuration="Release" /p:Platform="iPhone" /p:ArchiveOnBuild=true /p:CFBundleVersion=${FORMATTED_BUILD_NUMBER} /p:CFBundleShortVersionString=${FORMATTED_BUILD_NUMBER} /t:Clean /t:Build

then build the ipa with the archive...however I don't see anything about how to include the -exportArchive tag that you would include on xcode command line.

If it's not out there yet, I'll include it once I find it.

2

There are 2 answers

3
Rodney Littles On

Found the answer! I added the below and the archives started showing in the "Archive List" on VS4Mac! Still haven't tested the round trip to AppCenter, but it should be fine.

/p:ArchiveOnBuild=true
1
lovelejess On

I was able to use the following command to generate and output an IPA to the directory that I indicated here:

msbuild /p:Configuration='Release' /p:Platform='iPhone' /p:IpaPackageDir=<DIRECTORY FOR IPA TO LIVE>/t:Build '../SampleApp.sln' /p:BuildIpa=true

The trick for me was to set the flag: /p:BuildIpa=true

Hope this helps!