Skip to content

mlaunch: System.InvalidCastException when using with iOS 18 #22632

Open
@matouskozak

Description

@matouskozak

When testing dotnet/xharness dotnet/xharness#1345 on scouting queue including iOS 18.1 devices. We're seeing the following error message:

[12:27:27] dbug: [TCP tunnel] error MT0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
[12:27:27] dbug: [TCP tunnel] System.InvalidCastException: Unable to cast object of type 'Xamarin.Hosting.DeviceCtlDevice' to type 'Xamarin.Hosting.RealDevice'.
[12:27:27] dbug: [TCP tunnel]    at Xamarin.Hosting.DeviceDiscovery.FindDeviceWithAMDeviceAsync(String, Boolean , Boolean ) in /Users/builder/azdo/_work/9/s/src/Xamarin.Hosting/Xamarin.Hosting/DeviceDiscovery.cs:line 89
[12:27:27] dbug: [TCP tunnel]    at Xamarin.Launcher.DevController.CreateTcpTunnel(String, LaunchConfig) in /Users/builder/azdo/_work/9/s/src/Xamarin.Hosting/Xamarin.Launcher/controller-device.cs:line 860
[12:27:27] dbug: [TCP tunnel]    at Xamarin.Launcher.Driver.MainAsync() in /Users/builder/azdo/_work/9/s/src/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 534
[12:27:27] dbug: [TCP tunnel]    at Xamarin.Utils.NSRunLoopExtensions.RunUntilTaskCompletion[T](NSRunLoop, Task`1) in /Users/builder/azdo/_work/9/s/src/Xamarin.Hosting/Xamarin.Utils/Extensions.cs:line 29
[12:27:27] dbug: [TCP tunnel]    at Xamarin.Launcher.Driver.Main2(String[]) in /Users/builder/azdo/_work/9/s/src/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 441
[12:27:27] dbug: [TCP tunnel]    at Xamarin.Launcher.Driver.Main(String[]) in /Users/builder/azdo/_work/9/s/src/Xamarin.Hosting/Xamarin.Launcher/Main.cs:line 128
[12:27:27] dbug: [TCP tunnel] Process mlaunch exited with 1

full log: https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-xharness-refs-pull-1345-merge-4976d72e678241ea90/System.Buffers.Tests/1/console.b4419600.log?helixlogtype=result

This error was supposed to be fixed as per #22394 (comment) but appears to be still present. cc: @rolfbjarne

fyi: to test mlaunch changes on physical iOS 18 devices, you can use dotnet/xharness#1345, just updating the mlaunch to the latest version should be sufficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions