Build error MT0057 for .net Maui iOS, Mac Catalyst builds with no problem

New Contributor

I can build and run for Mac Catalyst fine with this command

dotnet build -t:Run -f net6.0-maccatalyst MyApp.csproj

but when I try to build for iOS using this command

dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=********-************** MyApp.csproj

I get this error

EXEC : error MT0057: Cannot determine the path to from the sdk root '/Library/Developer/CommandLineTools'. Please specify the full path to the bundle. [/Users/chris/Documents/Development/MyApp/src/MyApp/MyApp.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(897,5): error MSB3073: The command "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.302-preview.14.122/tools/bin/mlaunch --launchsim bin/Debug/net6.0-ios/iossimulator-x64/ --device :v2:udid=********-************ --stdout /dev/ttys000 --stderr /dev/ttys000 --wait-for-exit" exited with code 1. [/Users/chris/Documents/Development/MyApp/src/MyApp/MyApp.csproj]

It is odd that it can find XCode for Catalyst but cannot find it for iOS. Any help would be appreciated.

2 Replies

Hi @chrismg32,

Thanks for posting your issue here.

However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang

best response confirmed by chrismg32 (New Contributor)

@LanHuangThanks. I got an answer.

Xcode > Preferences > Locations > Command Line Tools did not have a value selected. Odd that is works for catalyst but not iOS but making sure the above tool has a value selected solved my problem.