Forum Discussion

AliDotNet1's avatar
AliDotNet1
Copper Contributor
Jan 21, 2024

Two .NET MAUI Build Questions

I am using the latest version of VS 2022 for Mac. I appreciate it if you could help me with the two questions below:

 

1 - When I build a solution for release, with the device-specific builds option turned off, does VS build the solution both for iOS and Android at the same time? I've always been under the impression that the target platform would be whatever is selected on the top/left dropdown, however recently I noticed that when I build for Android the build log includes lots of iOS-related references. In short, can I build once and then separately package for each platform?

 

2 - I'd like to build using the command line, I tried:

 

dotnet build \
-f net8.0-android \
-c Release

 

It builds fine, but it seems to be taking less than Visual Studio and I felt like the resultant application was running slower on the physical device. This can be purely psychological however, how can I make sure my command line does exactly the same as VS, including all the release-related improvements such as code shrinking etc ? Or better is it possible for you to share the CLI commands you use to build for IOS and Android before you release an application ?

 

Many thanks,

 

Ali

No RepliesBe the first to reply

Resources