SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-3297260%22%20slang%3D%22en-US%22%3EBuild%20error%20MT0057%20for%20.net%20Maui%20iOS%2C%20Mac%20Catalyst%20builds%20with%20no%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3297260%22%20slang%3D%22en-US%22%3E%3CP%3EI%20can%20build%20and%20run%20for%20Mac%20Catalyst%20fine%20with%20this%20command%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Edotnet%20build%20-t%3ARun%20-f%20net6.0-maccatalyst%20MyApp.csproj%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ebut%20when%20I%20try%20to%20build%20for%20iOS%20using%20this%20command%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Edotnet%20build%20-t%3ARun%20-f%20net6.0-ios%20-p%3A_DeviceName%3D%3Av2%3Audid%3D********-**************%20MyApp.csproj%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20get%20this%20error%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EEXEC%20%3A%20error%20MT0057%3A%20Cannot%20determine%20the%20path%20to%20Xcode.app%20from%20the%20sdk%20root%20'%2FLibrary%2FDeveloper%2FCommandLineTools'.%20Please%20specify%20the%20full%20path%20to%20the%20Xcode.app%20bundle.%20%5B%2FUsers%2Fchris%2FDocuments%2FDevelopment%2FMyApp%2Fsrc%2FMyApp%2FMyApp.csproj%5D%0A%20%20%20%20%20%20%20%20%20%20%0A%2Fusr%2Flocal%2Fshare%2Fdotnet%2Fsdk%2F6.0.201%2FSdks%2FMicrosoft.NET.Sdk%2Ftargets%2FMicrosoft.NET.Sdk.targets(897%2C5)%3A%20error%20MSB3073%3A%20The%20command%20%22%2Fusr%2Flocal%2Fshare%2Fdotnet%2Fpacks%2FMicrosoft.iOS.Sdk%2F15.2.302-preview.14.122%2Ftools%2Fbin%2Fmlaunch%20--launchsim%20bin%2FDebug%2Fnet6.0-ios%2Fiossimulator-x64%2FMyApp.app%2F%20--device%20%3Av2%3Audid%3D********-************%20--stdout%20%2Fdev%2Fttys000%20--stderr%20%2Fdev%2Fttys000%20--wait-for-exit%22%20exited%20with%20code%201.%20%5B%2FUsers%2Fchris%2FDocuments%2FDevelopment%2FMyApp%2Fsrc%2FMyApp%2FMyApp.csproj%5D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIt%20is%20odd%20that%20it%20can%20find%20XCode%20for%20Catalyst%20but%20cannot%20find%20it%20for%20iOS.%20Any%20help%20would%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3297260%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.NET%20MAUI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EiOS%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EmacOS%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3327065%22%20slang%3D%22en-US%22%3ERe%3A%20Build%20error%20MT0057%20for%20.net%20Maui%20iOS%2C%20Mac%20Catalyst%20builds%20with%20no%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3327065%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1278614%22%20target%3D%22_blank%22%3E%40LanHuang%3C%2FA%3EThanks.%20I%20got%20an%20answer.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EXcode%20%26gt%3B%20Preferences%20%26gt%3B%20Locations%20%26gt%3B%20Command%20Line%20Tools%3C%2FSTRONG%3E%3CSPAN%3E%20did%20not%20have%20a%20value%20selected.%3C%2FSPAN%3E%20Odd%20that%20is%20works%20for%20catalyst%20but%20not%20iOS%20but%20making%20sure%20the%20above%20tool%20has%20a%20value%20selected%20solved%20my%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3297335%22%20slang%3D%22en-US%22%3ERe%3A%20Build%20error%20MT0057%20for%20.net%20Maui%20iOS%2C%20Mac%20Catalyst%20builds%20with%20no%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3297335%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1375423%22%20target%3D%22_blank%22%3E%40chrismg32%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThanks%20for%20posting%20your%20issue%20here.%3C%2FP%3E%0A%3CP%3EHowever%20this%20platform%20is%20used%20for%20how-to%20discussions%20and%20sharing%20best%20practices%20for%20building%20any%20app%20with%20.NET.Since%20your%20issue%20is%20a%20technical%20question%2C%20welcome%20to%20post%20it%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fanswers%2Fproducts%2Fdotnet%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Q%26amp%3BA%3C%2FA%3E%20forum%2C%20the%20support%20team%20and%20communities%20on%20Microsoft%20Q%26amp%3BA%20will%20help%20you%20for%20any%20technical%20questions.%3CBR%20%2F%3EBesides%2C%20it%20will%20be%20appreciated%20if%20you%20can%20share%20it%20here%20once%20you%20post%20this%20technical%20question%20Microsoft%20Q%26amp%3BA.%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3ELan%20Huang%3C%2FP%3E%3C%2FLINGO-BODY%3E
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 Xcode.app from the sdk root '/Library/Developer/CommandLineTools'. Please specify the full path to the Xcode.app 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/MyApp.app/ --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)
Solution

@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.