ios.netobjective-cxcodemaui

How to generate an Xcode project from a MAUI iOS project?


I am trying to link an Objective-C static library against my MAUI iOS app and be able to debug it from Xcode. In order to do that, I'd need to generate the Xcode project out of the MAUI one. I cannot find any relevant information under the MAUI docs, other than a reference to an open sourced project called xcsync. However, when I run the tool, the project gets generated but it won't event build. (Multiple targets producing Info.plist, and missing MAUI class references)

xcsync generate \
  --project ./MyMauiApp.csproj \
  --target-framework-moniker net9.0-ios -f \
  --verbosity Detailed

Is generating the Xcode project even possible?


Solution

  • It's not supported. You are not able to generate an Xcode project from a MAUI iOS project.

    Note: If you want to link the Objective-C static library into your MAUI project, you have to make a .net-ios binding project.

    Please see Native Library Interop - .NET MAUI Community Toolkit - Community Toolkits for .NET | Microsoft Learn

    Getting Started with Native Library Interop - Community Toolkits for .NET | Microsoft Learn

    Creating Bindings for .NET MAUI with Native Library Interop - .NET Blog