VS2022 - iOS debugging on iPhone

Roman Drechsel 1 Reputation point
2022-08-04T11:51:39.587+00:00

Hi,

i try to debug my iOS app on my iPhone connected to my windows machine.

Automatic Deployment doesn't work, the log says "The Apple Developer Portal web API for creating certificates is no longer supported. Please create your certificate manually."

So i created a certificate on my MAC and imported it into visual studio. But i still don't have a profile.
I created it on the apple develper page, but how can i import them to visual studio?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,335 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 30,571 Reputation points Microsoft Vendor
    2022-08-05T10:04:48.24+00:00

    Hello,

    I created it on the apple develper page, but how can i import them to visual studio?

    Please try to download this profile into your Windows machine, then remove the profile to location folder : /user/AppData/local/Xamarin/iOS/provisioning/Profiles
    Your cer also need to import into %HOME%\AppData\Local\Xamarin\iOS\Provisioning\Certificates : Click “View Details” ->“Import Certificate”, choose your certificate .

    You said "I try to debug my iOS app on my iPhone connected to my Windows machine", so you are using Xamarin Hot Restart. There is a related bug been tracked by the product team - A valid provisioning profile for this executable was not found, and it is in MAUI project. Hot Restart still doesn't work for Xamarin projects. You could follow the progress or create a new one for Xamarin.

    In addition, please don't use this site to report product bugs or feature requests. This is a site for support, so please use the right site to requests new feature requests about a Microsoft product or report any bugs. If you want to report a problem about Visual Studio, see: Report a problem with Visual Studio - Visual Studio (Windows) | Microsoft Learn

    --Update--

    Does it work with MAUI then?

    You can follow the progress, it has been fixed in version 17.3 Preview 6, please check the latest preview version - Visual Studio 2022 version 17.4 Preview 1 and update your VS. Hot Restart works for MAUI and Xamarin right now. You need to generate an App Store Connect API Key and use that to add your Apple account, see : Creating API Keys for App Store Connect API. Then you can open VS, go to Tools->Options-> Apple Accounts >Individual Account (enter the API key)

    Or would it be easier then, when i connect my iphone to the mac?

    You can also try to connect your iPhone to the Mac, then Pair to Mac, and debug the app on your iPhone.

    I also can use Visual Studio for Mac and code on my mac?

    Sure, it's also a good option.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.