skip to Main Content

I have a MAUI Visual Studio project connected to an Apple MacBook. If I use the iPhone simulator I can change my C# code and clicking on "Hot Reload" I can see the changes almost instantly, but when I connect directly to my iPhone device "Hot Reload" does not seem to do anything and the only way to see my changes is to re-deploy the entire application.

Am I missing something or is it just that Hot Reload does not work on this scenario?

Note: This is different to XAML Hot Reload, which works fine for me in both a physical iPhone and on the simulator.

Hot Reload: https://learn.microsoft.com/en-us/visualstudio/debugger/hot-reload

XAML Hot Reload: https://learn.microsoft.com/en-us/dotnet/maui/xaml/hot-reload

2

Answers


  1. .NET MAUI XAML Hot Reload is a Visual Studio feature that enables you to view the result of XAML changes in your running app, without having to rebuild your project.

    Additionally, if you’re debugging on a physical iPhone and your app becomes unresponsive, check that the interpreter is enabled. To enable the interpreter on iOS, you need add below to your project setting(csproj):

    <PropertyGroup>
        <UseInterpreter Condition="$(TargetFramework.EndsWith('-ios'))">true</UseInterpreter>
    </PropertyGroup>
    
    Login or Signup to reply.
  2. It’s possible that Hot Reload may not work in the same way on a physical device compared to a simulator, as there may be additional complexities involved in deploying and updating the application on a real device.

    One possible solution is to try using the "Edit and Continue" feature instead of Hot Reload. This feature allows you to modify your C# code while your application is running, and see the changes immediately without having to re-deploy the entire application.

    To enable "Edit and Continue", go to the Project Properties -> Build tab and check the "Enable Edit and Continue" checkbox. You may also need to enable this feature in Visual Studio’s Debugging options.

    Another option is to use Live Reload, which is similar to Hot Reload but works by refreshing the entire application instead of just reloading the modified code. This may be slower than Hot Reload, but can still provide a faster development experience than having to re-deploy the entire application.

    To enable Live Reload, go to the Project Properties -> Debug tab and check the "Enable Live Reload" checkbox. You may also need to enable this feature in Visual Studio’s Debugging options.

    It’s also possible that there may be other factors affecting Hot Reload on a physical device, such as network connectivity or device configuration. You may want to try experimenting with different settings and configurations to see if you can get Hot Reload to work as desired.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search