1.确认dotnet版本
2.安装MAUI
3.使用 maui-check 命令行实用程序验证并安装缺少的组件
> dotnet tool install -g redth.net.MAUI.check> maui-check
如果步骤后续无法建立,使用visual studio方法直接安装在执行后续步骤
4.创建maui专案
5.执行模拟器
> "C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE" -no-boot-anim -avd pixel_5_-_api_30 -prop monodroid.avdname=pixel_5_-_api_30
or 安装插件
Setting
=>(设置成emulator位置)
ctrl+shift+p开启command
6.编译执行MAUI
dotnet build -t:Run -f net6.0-android
Reference:
.NET MAUI with .NET CLI (Command Line Interface)
Redth/dotnet-maui-check
欢迎大家来我的Blog看:
1.Blog: 文章连结