All skills
davidortinau avatar

/xamarin-ios-migration

@74acbe3

**WORKFLOW SKILL** - Guide for migrating Xamarin.iOS, Xamarin.Mac, and Xamarin.tvOS native apps to .NET for iOS, .NET for macOS, and .NET for tvOS. Covers SDK-style project conversion, target framework monikers, MSBuild property changes, Info.plist updates, iOS binding library migration, Xamarin.Essentials in native apps, NuGet dependency compatibility, and code signing changes. USE FOR: "migrate Xamarin.iOS", "upgrade Xamarin.iOS to .NET", "Xamarin.iOS to .NET for iOS", "iOS project migration", "Xamarin.Mac migration", "tvOS migration", "iOS binding library migration", "MtouchArch to RuntimeIdentifier", "Apple project migration". DO NOT USE FOR: migrating Xamarin.Forms apps (use xamarin-forms-migration), migrating Xamarin.Android apps (use xamarin-android-migration), creating new MAUI apps from scratch (use feature-specific MAUI skills).

Use this Skill: https://skilld.dev/gh/davidortinau/maui-skills/xamarin-ios-migration

This session only. Nothing lands on disk.

referencesios-migration-api.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Xamarin.iOS / Xamarin.Mac / Xamarin.tvOS Migration API Reference

SDK-Style Project File Templates

.NET for iOS

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0-ios</TargetFramework>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>true</ImplicitUsings>
    <SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
  </PropertyGroup>
</Project>

.NET for macOS (Mac Catalyst)

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0-macos</TargetFramework>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>true</ImplicitUsings>
    <SupportedOSPlatformVersion>10.15</SupportedOSPlatformVersion>
  </PropertyGroup>
</Project>

.NET for tvOS

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0-tvos</TargetFramework>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>true</ImplicitUsings>
    <SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
  </PropertyGroup>
</Project>

For library projects, omit <OutputType> or set to Library.

Replace net8.0 with net9.0 or net10.0 as appropriate. Valid TFMs: net8.0-ios, net8.0-macos, net8.0-tvos.


MSBuild Property Changes

Xamarin Property .NET Equivalent Action
MtouchArch / XamMacArch RuntimeIdentifier / RuntimeIdentifiers Convert (see table below)
HttpClientHandler / MtouchHttpClientHandler UseNativeHttpHandler Convert (see table below)
MtouchExtraArgs (some still apply) Copy and test
EnableCodeSigning (unchanged) Copy
CodeSigningKey CodesignKey Rename
CodesignKey (unchanged) Copy
CodesignProvision (unchanged) Copy
CodesignEntitlements (unchanged) Copy
CodesignExtraArgs (unchanged) Copy
PackageSigningKey (unchanged) Copy
PackagingExtraArgs (unchanged) Copy
ProductDefinition (unchanged) Copy
MtouchEnableSGenConc EnableSGenConc Rename
LinkDescription (unchanged) Copy

MtouchArch → RuntimeIdentifier Conversion

iOS

MtouchArch Value RuntimeIdentifier RuntimeIdentifiers
ARMv7 ios-arm
ARMv7s ios-arm
ARMv7+ARMv7s ios-arm
ARM64 ios-arm64
ARMv7+ARM64 ios-arm;ios-arm64
ARMv7+ARMv7s+ARM64 ios-arm;ios-arm64
x86_64 iossimulator-x64
i386 iossimulator-x86
x86_64+i386 iossimulator-x86;iossimulator-x64

Use RuntimeIdentifiers (plural) when targeting multiple architectures.

macOS

Value RuntimeIdentifier
x86_64 osx-x64

tvOS

Value RuntimeIdentifier
ARM64 tvos-arm64
x86_64 tvossimulator-x64

HttpClientHandler Conversion

Xamarin Value UseNativeHttpHandler
HttpClientHandler false
NSUrlSessionHandler (don't set — default)
CFNetworkHandler (don't set — default)

Info.plist Changes

Move MinimumOSVersion / LSMinimumSystemVersion from Info.plist to the project file:

<!-- BEFORE (Info.plist) -->
<key>MinimumOSVersion</key>
<string>13.0</string>

<!-- AFTER (csproj) -->
<PropertyGroup>
    <SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
</PropertyGroup>

Other Info.plist entries (display name, bundle identifier, permissions, etc.) remain in Info.plist.


NuGet Dependency Compatibility

Compatible Frameworks Incompatible Frameworks
net8.0-ios monotouch, xamarinios, xamarinios10
net8.0-macos monomac, xamarinmac, xamarinmac20
net8.0-tvos xamarintvos

Unlike Android, there is no backward compatibility with old Xamarin iOS/Mac TFMs. Packages must be recompiled for net8.0-ios etc.

.NET Standard libraries without incompatible dependencies remain compatible.


Xamarin.Essentials Namespace Mapping

Xamarin.Essentials .NET MAUI Namespace
App actions, permissions, version tracking Microsoft.Maui.ApplicationModel
Contacts, email, networking Microsoft.Maui.ApplicationModel.Communication
Battery, sensors, flashlight, haptics Microsoft.Maui.Devices
Media picking, text-to-speech Microsoft.Maui.Media
Clipboard, file sharing Microsoft.Maui.ApplicationModel.DataTransfer
File picking, secure storage, preferences Microsoft.Maui.Storage

Essentials Initialization (iOS)

using Microsoft.Maui.ApplicationModel;

[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
    public override UIWindow? Window { get; set; }

    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
        Window = new UIWindow(UIScreen.MainScreen.Bounds);
        var vc = new UIViewController();
        Window.RootViewController = vc;

        Platform.Init(() => vc);

        Window.MakeKeyAndVisible();
        return true;
    }
}

App Actions Override

public override void PerformActionForShortcutItem(
    UIApplication application,
    UIApplicationShortcutItem shortcutItem,
    UIOperationHandler completionHandler)
{
    Platform.PerformActionForShortcutItem(application, shortcutItem, completionHandler);
}

Supported / Unsupported Project Types

Project Type Status
Xamarin.iOS ✅ Supported
Xamarin.Mac ✅ Supported
Xamarin.tvOS ✅ Supported
iOS App Extensions ✅ Supported
SpriteKit / SceneKit / Metal ✅ Supported
Xamarin.watchOS ❌ Not supported
OpenGL (iOS) ❌ Not supported (OpenTK unavailable)

Source: SKILL.md on GitHub

No alerts15d4 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    The skill provides technical documentation, migration workflows, and project templates for upgrading Xamarin.iOS, Xamarin.Mac, and Xamarin.tvOS applications to .NET. It contains MSBuild property mapping tables and standard C# initialization code. No security issues or malicious patterns were detected.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • Runlayer6mo

    1/1 file flagged

Signed by skilld at 74acbe3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 6 months ago

README badge

README badge for davidortinau/maui-skills/xamarin-ios-migration