question

sunco avatar image
0 Votes"
sunco asked sunco commented

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

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://docs.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)


dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered sunco commented

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://docs.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.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your answer

I'm using VS 2022 17.0 (No prev version) - The issue is marked as Fixed in version 17.0

What about if I only need to test on my iPhone? Doesn't matter if Hot Reload works or not

Later, for production maybe I will be able to get a Mac

0 Votes 0 ·

What about if I only need to test on my iPhone? Doesn't matter if Hot Reload works or not

It supports to build the code on an iPhone. Follow the steps at: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart#initial-setup

And if you've any problems about the Xamarin Hot Start function, you could use the feedback tool at Help > Send Feedback > Report a Problem.

0 Votes 0 ·