question

ChrisGonzales-4336 avatar image
0 Votes"
ChrisGonzales-4336 asked ChrisGonzales-4336 commented

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

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.

dotnet-maui
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

WenyanZhang-MSFT avatar image
0 Votes"
WenyanZhang-MSFT answered ChrisGonzales-4336 commented

Hi @ChrisGonzales-4336 ,

It prompts that there is something wrong with the path /Library/Developer/CommandLineTools, please open Xcode and check Xcode > Preferences > Locations > Command Line Tools.
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.302-preview.14.122/tools/bin/mlaunch, the preview version is a little old, you could upgrade to the latest MAUI RC. The 15.2.302-preview.14.122 version on my side works fine, you could have a try.

My Testing :
1. Update : dotnet workload update
2. Create a MAUI project : sudo dotnet new maui -n 'HelloMAUI'
3. Build for iOS( cd to the project path, udid is the id of my simulator ) : dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=********-************** HelloMAUI.csproj

Note: my Command Line Tools location is /Applications/Xcode.app


Best Regards,
Wenyan Zhang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Xcode > Preferences > Locations > Command Line Tools did not have a value selected.

Odd that catalyst had no problems but iOS did. Resolved now. Thanks for your help.

0 Votes 0 ·