Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Debug On iOS Device After Installing .NET iOS 18.1.9163 #146

Closed
mlancione opened this issue Nov 26, 2024 · 9 comments
Closed

Cannot Debug On iOS Device After Installing .NET iOS 18.1.9163 #146

mlancione opened this issue Nov 26, 2024 · 9 comments
Labels
bug Something isn't working external other bug of dotnet / vscode / nodejs

Comments

@mlancione
Copy link

Getting the following Debug Console output when debugging on an iOS device after installing .NET iOS 18.1.9163 (released today):

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.1/18.1.9163/tools/bin/mlaunch
2
error MT0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
System.NotSupportedException: Specified method is not supported.
at Xamarin.Hosting.DeviceCtlDevice.CreateTcpTunnel(LaunchConfig) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Hosting/DeviceCtlDevice.cs:line 79
at Xamarin.Launcher.DevController.CreateTcpTunnel(String, LaunchConfig) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/controller-device.cs:line 844
at Xamarin.Launcher.Driver.MainAsync() in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 536
at Xamarin.Utils.NSRunLoopExtensions.RunUntilTaskCompletion[T](NSRunLoop, Task`1) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Utils/Extensions.cs:line 30
at Xamarin.Launcher.Driver.Main2(String[]) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 443
at Xamarin.Launcher.Driver.Main(String[]) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 130
System.NotSupportedException: Specified method is not supported.
at Xamarin.Hosting.DeviceCtlDevice.CreateTcpTunnel(LaunchConfig) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Hosting/DeviceCtlDevice.cs:line 79
at Xamarin.Launcher.DevController.CreateTcpTunnel(String, LaunchConfig) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/controller-device.cs:line 844
at Xamarin.Launcher.Driver.MainAsync() in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 536
at Xamarin.Utils.NSRunLoopExtensions.RunUntilTaskCompletion[T](NSRunLoop, Task`1) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Utils/Extensions.cs:line 30
at Xamarin.Launcher.Driver.Main2(String[]) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 443
at Xamarin.Launcher.Driver.Main(String[]) in /Users/builder/azdo/_work/2/s/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 130
@mlancione
Copy link
Author

mlancione commented Nov 26, 2024

These 2 .net changes could be related which have been committed to main but were not included in today's 18.1.9163 release:
xamarin/xamarin-macios@3d4ea05
xamarin/xamarin-macios@5b695a3

@JaneySprings
Copy link
Owner

JaneySprings commented Nov 27, 2024

Hi, @mlancione! Yes, something changed in the iOS workload.

xamarin/xamarin-macios#21664 (comment)

@JaneySprings JaneySprings added bug Something isn't working external other bug of dotnet / vscode / nodejs labels Nov 27, 2024
@JaneySprings
Copy link
Owner

JaneySprings commented Nov 27, 2024

@mlancione, I have created a 6.1.3 hotfix. I'm not sure that it is correct fix but it works for now =)

I will leave this issue opened until the official solution.

@mlancione
Copy link
Author

@JaneySprings Thanks for the quick fix! As always, your support is excellent! I can report that the debugging is working again with your change.

One side question, is it possible to display the output of the deployment progress while the app is being uploaded to the device? VS Mac used to show a console output with percentages.

@JaneySprings
Copy link
Owner

I use mlaunch --installdev:

public static void InstallDev(string serial, string bundlePath, IProcessLogger? logger = null) {
var tool = AppleSdkLocator.MLaunchTool();
logger?.OnOutputDataReceived(tool.FullName);
new ProcessRunner(tool, new ProcessArgumentBuilder()
.Append( "--installdev").AppendQuoted(bundlePath)
.Append($"--devname={serial}"), logger)
.WaitForExit();
}

and I don't know if it supports this functionality because this tool is closed-source.
Usually I look at circle progress on iOS device.

@mlancione
Copy link
Author

mlancione commented Nov 27, 2024

According to this commit there may be an "-install-progress" argument that can be used? If it works maybe you can add it as an optional feature?
xamarin/xamarin-macios#1483

In this newer post it looks like it's being launched with "--install-progress":
xamarin/xamarin-macios#21542

@JaneySprings
Copy link
Owner

Yes, it works, but we also need to disable device-ctl for installation.

new ProcessRunner(tool, new ProcessArgumentBuilder()
            .Append( "--installdev").AppendQuoted(bundlePath)
            .Append($"--devname={serial}")
            .Append( "--install-progress")
            .Append( "--use-device-ctl=false"), logger)
            .WaitForExit();
image

@mlancione
Copy link
Author

I think that looks great. Will help to monitor deployment status.

@JaneySprings
Copy link
Owner

Added in 6.1.4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external other bug of dotnet / vscode / nodejs
Projects
None yet
Development

No branches or pull requests

2 participants