Error when deploying Xamarin.Forms iOS App with XAML Hot Restart
Asked Answered
K

3

2

I am trying to use Xamarin.Forms with Hot Restart to develop an iOS App, but I keep get the following error when running the app from Visual Studio:

An error occurred while trying to deploy the app 'TestApp2.iOS.app'. Details: Error running hotrestart: 'An error occurred while deploying the application 'TestApp2.iOS.app' into 'iPhone'. Details: Could not write content to file 'PublicStaging/com.companyname.TestApp2'. ErrorCode: EmptyResponse'. Command: 'deploy -u=00000XXX-001D4C6XXXXXXXXX -i=com.companyname.TestApp2 -n=TestApp2.iOS.app'

Details:

  • Visual Studio v16.8.2 (and v16.9.0 Preview 1.0) on Windows 10

  • Xamarin.Forms v4.8.0.1687

  • Xamarin.Essentials v1.5.3.2

  • I used "Create new project" in VS, with the template "Mobile App (Xamarin.Forms)" (Only iOS, no Android). I've not done any manual changes to the project after it was created.

  • I have enabled Hot Restart via Tools -> Options -> Environment -> Preview Features -> Enable Xamarin Hot Restart

  • The phone is connected to the PC via USB cable and I can see the name of my phone appear on the "Play Button" in Visual studio.

  • I do not see any activity on my phone and nothing in the VS device log that seems related.

Any help would be much appreciated!

Kendrakendrah answered 30/11, 2020 at 18:50 Comment(0)
S
0

The phone is connected to the PC via USB cable and I can see the name of my phone appear on the "Play Button" in Visual studio.

You need a Mac and Pair to Mac for Xamarin.iOS development. Then we will see the following screenshot:

enter image description here

Now you can select one device from the device list to run.

enter image description here

================================update================================

First, enable hot restart in visual stuido 2019(here version is 16.8.2). Not forgert to restart the visual studio after enabling it.

enter image description here

Second, make sure the iTunes has logined a paid apple account and connect a physical device via usb.

enter image description here

Third, set iOS as the startup project, then you will see your physical device:

enter image description here

Last, setting provisioning file in ios Bndele Signing:

enter image description here

Now you can run it in your physical device.

Splendiferous answered 1/12, 2020 at 2:33 Comment(10)
I thought with the new Hot Reload functionality you didn't need a Mac in order to run a development build on a device?Bemock
@Bemock No, you also need a Mac to run the program.Splendiferous
I realized I was mixing together Hot Reload and Hot Restart. It was my impression after reading about Hot Restart that you could do that from a Windows PC. For example here: nicksnettravels.builttoroam.com/ios-dev-no-mac I also watched this video on channel9: channel9.msdn.com/Shows/XamarinShow/… Would it be correct to say that I still need to do the initial deploy to the phone from a Mac and then I can use a Windows PC to deploy changes to the app using Hot Restart?Kendrakendrah
@Kendrakendrah Hi, you are using a preview version of visual stuido 2019?Splendiferous
I've tried both the latest stable version (v16.8.2) and 16.9.0 Preview 1.0Kendrakendrah
@Kendrakendrah Hi, I have tried in my visual studio (16.8.2), and it works. Whether you use a paid apple account and select the matching provisioning file.Splendiferous
@Kendrakendrah I have updated the asnwer, you could have a look at that when you have time.Splendiferous
Thank you for the effort but I am afraid I still get the same error. I have tried restart of everything and to recreate the project. Everything works fine until I get the deploy errorKendrakendrah
@Kendrakendrah What device are you testing? You could have a check witht the limitations whether contains some points.learn.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/…Splendiferous
That is false u do not need a mac paired for hot reload hot reload should work with just a developer account thats the whole point and a iphoneAbukir
M
0

try to clear trusted computers on your iPhone, under Settings->Developer->Paired Devices, then reconnect the phone. It worked for me.

Maggee answered 7/9, 2022 at 8:51 Comment(0)
A
0

You don't need a mac to debug on physical device any more. There are some limitations but it works. Here are the best set up instructions I found so far: https://nicksnettravels.builttoroam.com/ios-dev-no-mac/

After following these instructions I was getting similar error. In my case it was ReSharper build runner that I had to disable and it all worked.

Against answered 17/1, 2023 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.