uno: iOS App is getting killed by Watchdog on physical device when debugging

I’m having a very annoying issue right now regarding iOS. I can’t debug on a physical device because the application is being killed by iOS Watchdog. I don’t understand why since it’s working fine on the simulator.

Here is the debug output.

Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Runtime.Numerics.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Formats.Asn1.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.Concurrent.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.Encoding.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.Algorithms.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.NonGeneric.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.X509Certificates.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Private.Uri.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Microsoft.Win32.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Security.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Quic.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.NameResolution.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.IO.Compression.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.IO.Compression.Brotli.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Threading.Channels.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Runtime.InteropServices.RuntimeInformation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Sockets.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.NetworkInformation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Diagnostics.DiagnosticSource.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Http.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Drawing.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.ServicePoint.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Requests.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Microsoft.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.Immutable.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ObjectModel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ComponentModel.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ComponentModel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.Specialized.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Diagnostics.TraceSource.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Text.RegularExpressions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Linq.Expressions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Private.Xml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Private.Xml.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ComponentModel.TypeConverter.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Foundation.Logging.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Foundation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Diagnostics.Eventing.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.UI.Dispatching.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Linq.Queryable.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Xaml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Runtime.CompilerServices.Unsafe.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.UI.Composition.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Console.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.UI.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Microsoft.Extensions.Logging.Abstractions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Chinook.StackNavigation.Abstractions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Chinook.SectionsNavigation.Abstractions.dll [External]
The app has been terminated.

Here is my configuration for debug.

<When Condition="'$(TargetFramework)'=='net6.0-ios'">
	<PropertyGroup>
		<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
		<MtouchExtraArgs>$(MtouchExtraArgs) --xml=./iOS/LinkerExclusions.xml --linkskip=$(AssemblyName)</MtouchExtraArgs>
		<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
		<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
		<!-- See https://github.com/xamarin/xamarin-macios/issues/14812 for more details. -->
		<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
		<MtouchLink>Full</MtouchLink>
	</PropertyGroup>
	<Choose>
		<When Condition="'$(Configuration)'=='Debug'">
			<PropertyGroup>
				<CodesignEntitlements>./iOS/Entitlements.plist</CodesignEntitlements>
				<MtouchDebug>True</MtouchDebug>
				<MtouchExtraArgs>$(MtouchExtraArgs) --optimize=-remove-dynamic-registrar --setenv=MONO_LOG_LEVEL=debug --setenv=MONO_LOG_MASK=gc</MtouchExtraArgs>
				<Optimize>False</Optimize>
			</PropertyGroup>
			<PropertyGroup Condition="'$(Platform)'=='iPhone'">
				<CodesignKey>iPhone Developer</CodesignKey>
			</PropertyGroup>
		</When>
</When>

This is why I think it`s the iOS Watchdog. image image

_Originally posted by @Soap-141 in https://github.com/unoplatform/uno/discussions/10746_

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Note that is not a behavior we can fix, it’s being tracked by microsoft https://github.com/dotnet/macios/issues/22310. If you have any additional information about the issue over there, it will help troubleshoot it further.

I have the same issue

Thanks for sharing. I am using VS on Windows with a iPhone connected via USB, no Mac involved. Is that relevant to my configuration?

I am using Visual Studio Code on Mac with iPhone connected via USB. It seems to be applied regardless of the development environment.

I tried deleting the cache files - still not working -> “The app has been terminated.”

I deleted C:\Users###\AppData\Local\Xamarin\iOS

C:\Users###\AppData\Local\Xamarin\iOS\Caches\Xamarin\XMA\Cache was empty

Also, after the deployment, VS placed an icon on my iPhone. The application crash when the VS is connected - it runs fine when the VS is not in connected/debug

@bodeg Try to delete ~/Library/Caches/Xamarin/XMA/SDK/dotnet/ then connect to your mac with VS, then try to debug your app, this helped someone I know.

I struggled same issue, and this solution works for me👍 thank you!

@bodeg Try to delete ~/Library/Caches/Xamarin/XMA/SDK/dotnet/ then connect to your mac with VS, then try to debug your app, this helped someone I know.

I’ve now started to experience this problem and I’m on VS 17.8.3. The start up does seem to take longer which makes watchdog kill the app. My setup is an iPhone Xs connected to my laptop via USB. This has been my setup for a long time and everything’s been working fine but now startup takes too long and the app crashes.

It was reported that recent versions of visual studio (17.8 and later) seem to have fixed this particular issue.

@MartinZikmund Not fixed at all, they released an update and closed it for the x time. Sometimes it works on small apps.

It’s not something we’ll be able to fix on our end, in all cases, so we’ll only be able to push on Microsoft to get this issue resolved.

This behaviour can be duplicated without Uno, just dotnet new ios and VSfM.

I have not tried from Windows but I doubt that would change anything since it ends up being the SDK’s mlaunch to install/launch the process to be debugged.