Last June, Apple announced that upcoming macOS releases would only support 32-bit applications “with compromises”. If your Mac application is not 64-bit, we strongly recommend taking action to avoid compromises in the next version of macOS.
Migration to Modern Xamarin.Mac
The most noteworthy update includes migrating your project to 64-bit. Older projects that are still using Xamarin.Mac Classic or MonoMac will need to be migrated to Xamarin.Mac Unified to support 64-bit. Visual Studio for Mac includes a migration wizard that will help automate many of the mechanical changes that are needed to update your Mac application. First, review any build warnings. Existing warnings may be pointing towards future issues and should be fixed prior to migration. Next, start the Migration Wizard from the Project > Migrate to Xamarin.Mac Unified API menu. The menu will not be visible if your application has already been migrated to Xamarin.Mac Unified (references Xamarin.Mac.dll).
After the automated migration wizard has finished, build your project to determine if additional changes are required. There were a number of API corrections made in Unified, and changes to your code may be required. More information can be found in the migration documentation.
The Journey to 64-bit
Xamarin.Mac Unified projects have support for building 64-bit binaries, but some existing and migrated projects may be building 32-bit instead. To verify your project’s settings, open the Project > Options menu and navigate to the Mac Build > Supported architectures setting. Select the x86_64
setting for 64-bit builds.
Moving from 32-bit to 64-bit may uncover a number of issues in your application, as it changes the size and alignment of data structures. This can affect custom P/Invoke invocations and native code linked in your application. Review any build warnings and test your application thoroughly to catch potential issues after updating.
Learn More
For additional information, visit our documentation on enabling 64-bit in your Mac applications.
Discuss this post on the Xamarin forums
0 comments