VS, iOS, Please select a valid device before running the application

sunco 121 Reputation points
2021-11-08T20:52:28.8+00:00

This has been asked several times, but there is something that is not clear to me

Using Xamarin Forms to create an app I'm able to run it on the Android Emulator and a real device

However, with iOS I'm not able to run on simulator or real device (iPhone). I got the "Please select a valid device before running the application" error

My question is, do I need a real Mac? https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/manual-provisioning?tabs=windows

I was thinking that the account and certificate part, also adding the device on the developer portal was enough

I'm running Windows 11, VS 2022 (launched today) and using an iPhone 8 15.0.2 (was using VS 2019 but here is an issue - https://developercommunity.visualstudio.com/t/Xamarin-iOS-deployment-failing-after-iOS/1541200)

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

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,956 Reputation points
    2021-11-09T05:52:17.667+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    I got the "Please select a valid device before running the application" error

    I tested the function on VS 2022 pre 5.0 and reproduce the issue. As the thread you posted, a fix for this issue has been internally implemented and is being prepared for release. Please wait for the release of the new pre version.

    My question is, do I need a real Mac?

    The answer is yes if you plan to publish the iOS project. Xamarin Hot Start has some limitations for developing iOS project. It doesn't support to use Xamarin Hot Restart to create app bundles for publishing. We still need a Mac machine to do a full compilation, signing, and deployment for your application to production.

    Here is the related doc, you could refer to it.
    https://learn.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart#limitations

    Best Regards,

    Jarvan Zhang


    If the response is helpful, 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.