The short answer
Short answer: App IDs and provisioning profiles are created on the Apple Developer website, which works from Windows. Signing itself is done by tools on the Mac, so the distribution certificate's private key must be in that Mac's keychain. The least-effort route is to generate the certificate request on the remote Mac itself.
Which steps require macOS
Which step cannot leave macOS
- The signing itself.
dotnet publishcalls Apple's signing tools on the Mac, which sign the app with the certificate and private key in the keychain. - In Microsoft's documentation, Visual Studio on Windows can create a distribution certificate and download provisioning profiles under "Tools > Options > Xamarin > Apple Accounts". The same documentation notes that the private key and certificate are only exported to the Mac build host's keychain when the IDE is already paired to a Mac. So this route depends on Pair to Mac being able to connect.
What you can do on Windows first
- Register the App ID and create the provisioning profile (which needs a certificate first) in the Apple Developer account.
- Confirm
ApplicationIdin the.csproj. The documentation states it is the app's Bundle Identifier, and changing it automatically updates the matching value in Info.plist.
Microsoft's documentation carries a warning about losing the certificate and key: the consequence is revoking the existing certificate and recreating the provisioning profiles. A rented machine is reclaimed after the rental ends, so deal with this ahead of time. See the last step.
How to do it on a remote Mac
Generate the certificate request in the remote Mac's keychain
On the remote Mac, open Keychain Access and generate a CSR file following Apple's Create a certificate signing request instructions. At that point the private key is already stored in this Mac's login keychain. The menu location changes between macOS versions, so follow Apple's documentation.
Create and install the distribution certificate
On the certificates page of the developer account, create a new certificate and choose the type used for App Store distribution (the MAUI docs call it iOS Distribution; the newer name is Apple Distribution). Upload the CSR you just made, download the resulting certificate file, and double-click it on the remote Mac to install. This step fails if your account's role in the team does not have enough permission.
Register the App ID and keep capabilities matching on both sides
An explicit App ID maps to a single app and is required when you use capabilities such as Apple Pay or Game Center. A wildcard ID suits multiple apps that enable no app-specific capabilities. The Bundle ID must match
ApplicationIdexactly.The MAUI documentation stresses that every capability the app uses has to be both ticked on the App ID page and written into the project's
Entitlements.plist. Doing only one side causes problems at signing time or at runtime.Create an App Store provisioning profile
On the Profiles page, create a new profile, choose the App Store type, then select the App ID you just registered and the distribution certificate. Give it a name and write it down, because this name goes into
CodesignProvisionlater. Download the profile to the remote Mac and install it. The storage directory has changed across Xcode versions, so follow the MAUI publishing docs and Apple's documentation.Look up the full signing identity name and put it in the project
Run
security find-identity -v -p codesigningin Terminal. The whole string in the output that looks likeApple Distribution: Name (Team ID)is the value forCodesignKey. Then:CodesignKey: the full name you just looked up.CodesignProvision: the name of the provisioning profile.CodesignEntitlements: if you use capabilities, the path toEntitlements.plist.
You can put these in a conditional property group in the
.csproj, or pass them with-p:atdotnet publishtime. The advantage of the conditional property group is that Debug builds do not pick up distribution signing.Export a p12 backup
In Keychain Access, export the certificate together with its private key as a
.p12, set an export password, and save it to your own storage. Sign out of your Apple Account before the rental ends. Once the machine is reclaimed, the private key in its keychain is not kept. With the p12 you can import it on another Mac and keep using the same certificate.
FAQ
The build says no signing identity was found. What do I check first?
Run security find-identity -v -p codesigning on the remote Mac first. If the distribution certificate is not listed, most likely only the certificate file was installed and the private key is not on this machine (for example, the CSR was generated on a different computer). The fix is to export a p12 from the original machine and import it, or to go through the CSR flow again on this Mac.
Does MAUI have automatic signing?
Visual Studio's project properties offer an Automatic Provisioning scheme, which the documentation mostly covers in the context of device debugging and Hot Restart. The command-line publishing docs use explicit CodesignKey and CodesignProvision. This page follows the latter because it can be reproduced as-is in Terminal on a remote Mac.
Are there other signing-related checks before submitting to the App Store?
Apple requires the app bundle to include a privacy manifest file declaring data collection and the reasons for using certain APIs. Missing declarations can get the app rejected. For how to do it in MAUI, see Microsoft's Apple privacy manifest documentation.
What should I watch for when signing in to my developer account on a rented machine?
You can sign in with your own Apple Account, and we recommend a dedicated account. Find My Mac must stay off, and you should sign out before the rental ends. Two-factor verification codes go to your own devices, so stay near them while you work. More in can I sign in to my own developer account.
Related
- How do I build an iOS ipa from a .NET MAUI app without a Mac?
- How do I upload a .NET MAUI app to TestFlight and the App Store without a Mac?
- Can I sign in with my own Apple Developer account on a rented Mac?
- How do I sign an iOS app and upload it to the App Store from a remote Mac?
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support