Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Can't run MAUI app on real iPhone (only simulator). Error EXEC : error MT1207: Could not find the simulator device type 'iPhone 4s'. #43

Closed
bruno-garcia opened this issue Dec 2, 2023 · 3 comments

Comments

@bruno-garcia
Copy link
Member

On the following issue it's discussed running a mobile app on a real iOS device from the command line:

The last suggestion from @rolfbjarne, which solved the problem to someone, was:

@anpin for running on device, omit the :v2:udid= part, and just pass the UDID directly (/p:_DeviceName=UDID).

I tried it, but failed with:

EXEC : error MT1207: Could not find the simulator device type 'iPhone 4s'. [/Users/bruno/git/AnchorAlertApp/AnchorAlertApp.csproj::TargetFramework=net8.0-ios]
/usr/local/share/dotnet/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(1056,5): error MSB3073: The command "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.0.8478/tools/bin/mlaunch --launchsim bin/Debug/net8.0-ios/iossimulator-arm64/AnchorAlertApp.app/ --device 00009999-000FFFFFFFFFFFFF --stdout /dev/ttys001 --stderr /dev/ttys001 --wait-for-exit:true" exited with code 1. [/Users/bruno/git/AnchorAlertApp/AnchorAlertApp.csproj::TargetFramework=net8.0-ios]
    0 Warning(s)
    2 Error(s)

I see in the path iossimulator-arm64 and since I put a real device id, I imagine it should be ios-arm64 or whatever it should be for real device, but not sure how to control that.

Environment:

I'm on SDK 8.0.100 with a new MAUI app from template (basically at this commit sha).

The command I ran, (real device id replaced):

dotnet build -t:Run -f net8.0-ios -p _DeviceName=00009999-000FFFFFFFFFFFFF

Here's the csproj. And here's the Info.plist

Running from JetBrains Rider 2023.2.3 fails with Failed to parse bundle identifier, which is required to launch application on a connected device and I can't figure out why (already changed it and no luck. Tried with 2023.3 RC and there it says the project is setup only for iPad and grays out all iPhone (simulator and real device).

My last attempt was to use xcode and load the project from obj/Xcode but that doesn't exist.

So I'm blocked from running this on a real device.

@rolfbjarne
Copy link
Member

Try passing the runtime identifier like this:

dotnet build -t:Run -f net8.0-ios -p _DeviceName=00009999-000FFFFFFFFFFFFF -p:RuntimeIdentifier=ios-arm64

@bruno-garcia
Copy link
Member Author

Worked, thanks! I do believe this experience can be improved somehow. Can we figure out the rid of the device since we have its id?

I'll reply on that issue tracking the default dev experience.

@rolfbjarne
Copy link
Member

The runtime identifier for all physical iOS devices is ios-arm64 (this includes both iPads and iPhones).

I do believe this experience can be improved somehow.

It was designed to be used from inside an IDE, in which case you just select where you want to run and then the IDE figures this out for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants