Can I change the output path of the IPA file?

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

For Cycle 7 and higher

Yes, you can use customized MSBuild targets to achieve this. The easiest option is probably to copy the .ipa file after it has been built.

These steps will work for any iOS project that uses the MSBuild build engine on either Mac or Windows. (Note: all Unified API projects use the MSBuild build engine.)

1. Open the .csproj file for the iOS app project in a text editor and then add the following lines at the end (immediately before the closing </Project> tag).

<PropertyGroup>
       <CreateIpaDependsOn>
       $(CreateIpaDependsOn);
        CopyIpa
       </CreateIpaDependsOn>
</PropertyGroup>

<Target Name="CopyIpa"
    Condition="'$(OutputType)' == 'Exe'
        And '$(ComputedPlatform)' == 'iPhone'
        And '$(BuildIpa)' == 'true'">
    <Copy
        SourceFiles="$(IpaPackagePath)"
        DestinationFolder="$(OutputPath)"
    />
</Target>

2. Set the DestinationFolder to the desired output folder. As usual you may use MSBuild properties (like $(OutputPath)) within this argument if you wish.

Notes

  • The CreateIpaDependsOn property is defined in the Xamarin.iOS.Common.targets file that is part of Xamarin.iOS. It behaves as described under Overriding 'DependsOn' Properties on https://msdn.microsoft.com/en-us/library/ms366724.aspx.

  • You could use a Move Task rather than a Copy Task if you preferred. If you choose that option and you are building on Windows, you will need to use the fully-qualified task name <Microsoft.Build.Tasks.Move> to avoid an ambiguity with the XamarinVS build tasks.

Contact information

This document discusses the current behavior as of Xamarin 4.1.1 for Visual Studio and Xamarin.iOS 9.8.1 on the Mac build host. The technique described in this document is not part of the stable testing suite for Xamarin, so it could break in the future.

If you notice that the technique no longer works on a more recent version, or if you notice any other mistakes in the document, please let us know by writing to hello@xamarin.com. Thanks!

For versions before Cycle 7

Yes, you can use customized MSBuild targets to achieve this. The easiest option is probably to copy the .ipa file after it has been built.

These steps will work for any iOS project that uses the MSBuild build engine on either Mac or Windows. (Note: all Unified API projects use the MSBuild build engine.)

1. Open the .csproj file for the iOS app project in a text editor and then add the following lines at the end (immediately before the closing </Project> tag).

<PropertyGroup>
    <CreateIpaDependsOn>
        $(CreateIpaDependsOn);
        CopyIpa
    </CreateIpaDependsOn>
</PropertyGroup>

<Target Name="CopyIpa"
    Condition="'$(OutputType)' == 'Exe'
        And '$(ComputedPlatform)' == 'iPhone'
        And '$(BuildIpa)' == 'true'">
    <Copy
        SourceFiles="$(OutputPath)$(IpaPackageName)"
        DestinationFolder="/Users/macuser/Desktop/"
    />
</Target>

2. Set the DestinationFolder to the desired output folder. As usual you may use MSBuild properties (like $(OutputPath)) within this argument if you wish.

Notes

  • The CreateIpaDependsOn property is defined in the Xamarin.iOS.Common.targets file that is part of Xamarin.iOS. It behaves as described under Overriding "DependsOn" Properties on https://msdn.microsoft.com/en-us/library/ms366724.aspx.

  • You could use a Move Task rather than a Copy Task if you preferred. If you choose that option and you are building on Windows, you will need to use the fully-qualified task name <Microsoft.Build.Tasks.Move> to avoid an ambiguity with the XamarinVS build tasks.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.