Reputation: 509
I started developing a little Bluetooth app with MAUI, with Visual Studio 2022 on Windows. I wanted to deploy it on a iOS device, so I switched to a Mac, using VS Code (because of the end of support of VS for MAC on August 2024).
The App launched well on an iOS emulator, but, of course, the bluetooth won't work. So I switched to a iOS device deployment.
I ran the following command:
dotnet build MyMauiApp.csproj -t:Run -f .net8.0-ios -p:_DeviceName=[DeviceId] -p:RuntimeIdentifier=ios-arm64
And I got the following error:
iOS code signing key 'Apple Development: ????' not found in keychain
I searched for informations about this code signing key, I found that I have to add those 2 entries to the first PropertyGroup section of the .csproj:
<CodesigningKey>Apple Development: [What do I have to put in there ???]</CodesigningKey>
<CodesignProvision>[What do I have to put in there ???]</CodesignProvision>
<ProvisioningType>manual</Provisioningtype>
But what to put in those two entries ?
I went to XCode, logged to my developer account and created a certificate, used the certificate name as CodesigningKey (Apple Development: MyCertificateName), but it doesn't work either...
All the informations I have found are treated for Xamarin and VS for mac but it's kind of difficult to find anything about VSCODE / MAUI / IOS.
Thanks in advance for your help.
I tried to change the CodesignKey entry, create a certificate, login to developer account.
Upvotes: 1
Views: 5044
Reputation: 34083
This is all described in the official Microsoft Learn Docs.
You will want to follow this page up until it actually goes to publish the app from Visual Studio.
Instead, you probably want to go into Xcode, then click the Xcode menu > Settings > Accounts > Download manual profiles. Under Manage Certificates... make sure that there is an active certificate on this machine. If not, create a new one (from that same dialog with the little + icon) and restart from the top and make sure to include that new certificate in the provisioning profile.
Then, from VS Code you're basically publishing from the command-line, so switch to this page and read through the different options.
As for your concrete questions:
Apple Development: [What do I have to put in there ???]
That will be the name of the certificate, the one you saw in Xcode. Go into your Keychain app, search for the name that you see in Xcode and copy whatever is in the name field for that certificate. It will always follow the pattern of "Apple Development: {some name here} ({some id here})" or "Apple Distribution: {some name here} ({some id here})"
[What do I have to put in there ???]
That will be the name of the provisioning profile that you created in the Apple Developer Portal earlier, a name you have made up.
Hope this helps!
Upvotes: 4