maui
maui copied to clipboard
Can't run the application on physical iOS device
Description
I've updated my M2 Mac Mini to the latest Sonoma and I can't debug my application anymore. Application builds, deploys, launches, and never passes splash screen. Visual Studio has "The app has been terminated." in Debug Output.
I've tried to create a new MAUI app and the result is the same.
It works with iOS simulator.
I tried to do the same thing on the Mac itself using Rider and I got a deployment error. So I assume it's not a VS issue.
Workloads list:
Installed Workload Id Manifest Version Installation Source
---------------------------------------------------------------------
android 34.0.52/8.0.100 VS 17.9.34407.89
ios 17.0.8490/8.0.100 VS 17.9.34407.89
maui-windows 8.0.3/8.0.100 VS 17.9.34407.89
maccatalyst 17.0.8490/8.0.100 VS 17.9.34407.89
Steps to Reproduce
- Create new MAUI project
- Connect VS to Mac build host
- Start debugging
Expected outcome: app starts and debugger attaches Outcome: app starts, but gets terminated on a splashscreen
Link to public reproduction project repository
No response
Version with bug
Unknown/Other
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.3
Affected platforms
iOS
Affected platform versions
iOS 17
Did you find any workaround?
no
Relevant log output
Build log:
Launching 'MauiApp1' on 'Michael’s iPhone SE'...
Launching...
Xamarin.Hosting: Device discovery started
Using Xcode 15.0 found in /Applications/Xcode.app/Contents/Developer
Xamarin.Hosting: Device discovery event: Connected (00008030-001428D23AE8C02E)
Xamarin.Hosting: Connected to Michael???s iPhone SE (00008030-001428D23AE8C02E) in 00:00:00.0037840
Xamarin.Hosting: Xcode: /Applications/Xcode.app
Xamarin.Hosting: Version: 699ed5eaf2 (refs/heads/main)
Xamarin.Hosting: Xamarin.Hosting
Xamarin.Hosting: Verbosity: 1
Xamarin.Hosting: Xcode Version: 15.0
xcrun devicectl -j /var/folders/m0/668nqyl96k3g67lblgmv86yh0000gn/T/tmpUNEYBe.tmp -v device info lockState --device "Michael???s iPhone SE"
? unlockedSinceBoot: true
? passcodeRequired: false
Saving JSON output file to /var/folders/m0/668nqyl96k3g67lblgmv86yh0000gn/T/tmpUNEYBe.tmp
Command Completed, took 0.387 seconds
? deviceIdentifier: 32C0EFC3-BB80-4F6C-AA6D-79F011142A52
2023-12-22 01:07:28.739-0700 Acquired usage assertion.
2023-12-22 01:07:28.738-0700 Acquired tunnel connection to device.
Current device lock state:
Using verbose logging.
xcrun devicectl -j /var/folders/m0/668nqyl96k3g67lblgmv86yh0000gn/T/tmph4l3pr.tmp -v device process launch --terminate-existing --device "Michael???s iPhone SE" com.companyname.mauiapp1 --monodevelop-port 10000 --connection-mode usb
Command Completed, took 0.403 seconds
Saving JSON output file to /var/folders/m0/668nqyl96k3g67lblgmv86yh0000gn/T/tmph4l3pr.tmp
Launched application with com.companyname.mauiapp1 bundle identifier.
2023-12-22 01:07:29.477-0700 Acquired usage assertion.
2023-12-22 01:07:29.302-0700 Acquired tunnel connection to device.
2023-12-22 01:07:29.303-0700 Enabling developer disk image services.
Using verbose logging.
The app 'com.companyname.mauiapp1' launched with pid 9774
Launch succeeded. The app 'MauiApp1' has been successfully launched on 'Michael’s iPhone SE'.
Debug log:
The app has been terminated.
I tried to do the same thing on the Mac itself using Rider and I got a deployment error. So I assume it's not a VS issue.
There is currently a bug in the latest Rider release (2023.3.2), preventing iOS from launching. It gives a generic "Deployment failed. See deployment output for details." error, so if this is what you're experincing on Rider, you could try downgrading to 2023.3.1 to see if the issue is still present - otherwise it might be configuration/VS related
Ok, so issues on the Mac (rider IDE) and Windows (VS IDE) are most likely not connected.
I didn't change any VS settings since I was able to debug several days ago.
Also tried to run from Mac with VSCode and it works. So this issue is most likely VS related
There is a known issue that causes long build times when deploying to iOS, and because iOS terminates the app after 20 seconds or so we are stuck at the splashscreen before the app is terminated. Github issue
I think this is something else. iOS is slow to start under debug, but empty new app should be able to launch (also my app was working fine before and there were no significant changes made).
I've found this thread on VS feedback forum, it seems like a regression in VS.
Verified this issue with Visual Studio 17.10.0 Preview 1. Not repro on iOS device. I tried M2's Sonoma and Ventura systems, and they were both successfully deployed.
It works with VS after the VS update. Didn't try Rider yet. Will try and post here.