How can i ?
Deprecated mdtool supported archive option, what about xbuild ?
(Thanks to Grigory for bringing this question to the attention of the Xamarin support team via email.)
The Xamarin.iOS Unified API MSBuild targets include an "Archive" target that will produce a .xcarchive
bundle under ~/Library/Developer/Xcode/Archives
. To activate this target, set the ArchiveOnBuild
property to true
.
Example:
xbuild /p:Configuration=Release /p:Platform=iPhone /p:ArchiveOnBuild=true /t:"Build" MyProject.csproj
This "Archive" target is not currently mentioned in the documentation (it should be!). The Xamarin Support team has accordingly requested a new section in the Xamarin.iOS docs to match the Android Build Targets section in the Xamarin.Android documentation.
EDIT Oct 3: Correct example command line based on Craig_Horsfield's findings.
Answers
I see an article - http://developer.xamarin.com/guides/cross-platform/ci/teamcity/ which describes how to integrate with teamcity, but, Xamarin guys, you write there about mdtool! And at the same time you say that it is deprecated and for Unified projects it is better to use xbuild.
Please provide better documentation for basic features of the product you sell!
I second that, how do you create an archive with xbuild as you ask us to move away from mdtool ?
Up!
Same, we'd like our build server to produce enterprise and store builds. It's pretty difficult to set this up if the tools don't support doing it without a person manually clicking stuff.
To be clear I followed the directions to produce an enterprise build IPA. You get an IPA but it's not signed and not suitable for distribution. I suppose I need to go figure out how to resign it myself but come on guys, that's a really lame way to go about this.
(Thanks to Grigory for bringing this question to the attention of the Xamarin support team via email.)
The Xamarin.iOS Unified API MSBuild targets include an "Archive" target that will produce a
.xcarchive
bundle under~/Library/Developer/Xcode/Archives
. To activate this target, set theArchiveOnBuild
property totrue
.Example:
This "Archive" target is not currently mentioned in the documentation (it should be!). The Xamarin Support team has accordingly requested a new section in the Xamarin.iOS docs to match the Android Build Targets section in the Xamarin.Android documentation.
EDIT Oct 3: Correct example command line based on Craig_Horsfield's findings.
After much trying it does not work to set the Target to Archive. There are a lot of dependencies in the build \ archive process that fail. Looks like you should not call Archive as the target.
This seems to work in you IOS project just add this to you app store Store configuration section for the project
Good catch Craig, thanks! I have edited the example command line in my previous post accordingly:
ArchiveOnBuild
is set totrue
.ArchiveOnBuild
istrue
, so it's sufficient to use/t:"Build"
.Would it work on Xamarin 8.9 ? Or it is something new from Xamarin 9.2
The "Archive" target does indeed require Xamarin.iOS 9.0 or higher (currently available in the Stable updater channel). In Xamarin.iOS 8.x the
.xcarchive
logic was only available formdtool
.@BrendanZagaeski I was going to contact support prior to find this thread
Do you have any idea if your team planned to support it also from VS? looks like a must to have for me since crashes are integrated in XCode organizer...
Edit: Looks like command line is working fine from msbuild command line too... especially if you are using the correct version specified in the post just above ^^ Great work!
There is a missing REQUIRED parameter for the info.plist file contained in the .xcarchive file =>
CFBundleVersion
must be specified in addition toCFBundleShortVersionString
.If this string is not present, the archive will not be associated to the right iOS app and will instead appear as "Other Items"
Is there any way to specify the
.xcarchive
package destination? Since xcode 5 it is possible to set it with -archivePath and I'm missing this option inxcode
andmdtool
(ref: http://stackoverflow.com/a/20905823/281188)
The exact location (depending on timestamp) where the last archive has been saved would also help
Hi,
Does anyone solved the issue that @GuillaumeGirard has pointed out? xbuild creates the Info.plist without the
CFBundleVersion
string. I'm running the xbuild command from jenkins in order to make a valid TestFlight build.Update to my previous comment:
I succeeded uploading a valid TestFlight build with the command line tool Pilot, but in the Archives list the Bundle Version is not shown. It seems that not adding the
CFBundleVersion
to the Info.plist created with xbuild is not such a serious issue.For anyone else who is running into this issue with CFBundleVersion not being set, I had my build pipeline execute this command after the archive was created to insert the correct build number into the Info.plist
This is fun - late last year when I was creating out build scripts, Xamarin CI setup said to use mdtool as you can see in the wayback machine here: https://web.archive.org/web/20151124033608/https://developer.xamarin.com/guides/cross-platform/ci/teamcity/
Now it's broken - sheesh. Now I have to figure out how to get the same results using xbuild. Why don't they announce or write documents telling us what is changing, and why?
Regular enterprise companies would never do this - including Microsoft.
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Xamarin.iOS 10.3.1.8 (7beaef4)
I have following error in VS if I do add:
to my project file.
The "Xamarin.Messaging.Tasks.CreateArchiveDirectory" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.Messaging.Tasks.dll. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
In spite of this error I can find xcarchive file in $HOME/Library/Developer/Xcode/Archives, but for some reason there are two files produced during single build:
What is wrong here?
Just found this thread about error, so its clear now.
But question about 2 two archive files is still open.