-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaui_cli_commandlineinterface.html
More file actions
244 lines (218 loc) · 9.96 KB
/
Copy pathmaui_cli_commandlineinterface.html
File metadata and controls
244 lines (218 loc) · 9.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE html>
<html class="wide wow-animation" lang="en">
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8026277731801765"
crossorigin="anonymous"></script>
<!-- Site Title-->
<title>.NET MAUI with .NET CLI (Command Line Interface).</title>
<meta content=".NET MAUI with .NET CLI (Command Line Interface)."
name="description">
<meta content=".NET MAUI CLI, .NET MAUI Command Line Interface"
name="keywords">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Stylesheets-->
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,200;0,300;0,500;0,600;1,300&display=swap">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="page-loader">
<div class="cssload-container">
<div class="cssload-speeding-wheel"></div>
</div>
</div>
<!-- Page-->
<div class="page">
<!-- Page header-->
<header class="page-header">
<!-- RD Navbar-->
<div class="rd-navbar-wrap">
<nav class="rd-navbar novi-bg novi-bg-img" data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-layout="rd-navbar-fixed" data-lg-layout="rd-navbar-fixed" data-xl-layout="rd-navbar-static" data-xxl-layout="rd-navbar-static" data-sm-device-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed" data-lg-device-layout="rd-navbar-fixed" data-xl-device-layout="rd-navbar-static" data-xxl-device-layout="rd-navbar-static" data-stick-up-clone="false" data-sm-stick-up="true" data-md-stick-up="true" data-lg-stick-up="true" data-xl-stick-up="true" data-xxl-stick-up="true" data-lg-stick-up-offset="69px" data-xl-stick-up-offset="1px" data-xxl-stick-up-offset="1px">
<div class="rd-navbar-inner">
<!-- RD Navbar Panel-->
<div class="rd-navbar-panel">
<button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"><span></span></button>
<!-- RD Navbar Brand-->
<div class="rd-navbar-brand">
<!-- Brand-->
<!--
<a class="brand" href="index.html"><img class="brand-logo-dark" src="images/logo-default-347x65.png" alt="" width="173" height="32" /><img class="brand-logo-light" src="images/logo-inverse-347x65.png" alt="" width="173" height="32" /></a>
-->
<div><a href="index.html" style="color:black;margin-top:2.5px;font-size:22px;">MAUIMAN.dev</a></div>
</div>
</div>
<!-- RD Navbar Nav-->
<div class="rd-navbar-nav-wrap">
<ul class="rd-navbar-nav">
<li><a href="index.html">Home</a></li>
<!--
<li class="active"><a href="index.html#articles">Articles</a></li>
<li class="active"><a href="index.html#samples">Samples</a></li>
-->
<!--
<li class="active"><a href="index.html#templates">Templates</a></li>
<li class="active"><a href="index.html#components">Components</a></li>
-->
</ul>
</div>
</div>
</nav>
</div>
</header>
<!-- Breadcrumbs-->
<section class="section novi-bg novi-bg-img breadcrumbs-custom">
<div class="container">
<div class="breadcrumbs-custom__inner">
<p class="breadcrumbs-custom__title">MANual page for .NET MAUI DEVelopers</p>
<ul class="breadcrumbs-custom__path">
<li><a href="index.html">Home</a></li>
<li class="active">MAUI</li>
</ul>
</div>
</div>
</section>
<section class="section novi-bg novi-bg-img bg-default section-lg">
<div class="container">
<div class="row row-fix row-70">
<div class="col-lg-7 col-xl-8 section-divided__main group-post">
<!-- Post standard-->
<div class="section-md">
<article class="post-classic">
<div class="post-classic-title">
<h4>.NET MAUI with .NET CLI (Command Line Interface)</h4>
</div>
<div class="post-classic-body">
<p>
This article describes how to develop a .NET MAUI app with the .NET CLI (Command Line Interface).
</p>
<p>
.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML that can run on Android, iOS, macOS, and Windows from a single shared code-base.
</p>
<p>
1. Install .NET SDK.
</p>
<p>
<kbd><a href=https://dotnet.microsoft.com/en-us/download>https://dotnet.microsoft.com/en-us/download</a></kbd>
</p>
<p>
2. Install .NET MAUI workload with the dotnet CLI. A .NET "workload" is a collection of packs. Launch a command prompt and enter the following:
</p>
<p>
<kbd>dotnet workload install maui</kbd>
</p>
<p>
<img src=images/dotnetmauiworkloadwindows.png />
</p>
<p>
Check that the MAUI workload installs successfully.
</p>
<p>
<kbd>dotnet workload list</kbd>
</p>
<p>
<img src=images/maui_windows.png />
</p>
<p>
3. Verify and install missing components with maui-check command line utility.
</p>
<p>
<kbd>dotnet tool install -g redth.net.MAUI.check</kbd>
</p>
<p>
<kbd>maui-check</kbd>
</p>
<p>
4. Create a new folder and a new MAUI app.
</p>
<p>
<kbd>mkdir MyMauiApp</kbd>
</p>
<p>
<kbd>cd MyMauiApp</kbd>
</p>
<p>
<kbd>dotnet new maui</kbd>
</p>
<p>
5. The "dotnet new maui" command generates a template for a .NET MAUI app with all the necessary project, C#, and XAML files. You can use any editor such as Notepad or <a href="https://code.visualstudio.com/Download" rel="nofollow">Visual Studio Code</a> to edit the files.
</p>
<p>
If you are using Visual Studio Code, enter the following command in the Command Prompt to view the source code generated in the "MauiQRCodeApp" folder.
</p>
<p>
<kbd>code .</kbd>
</p>
<p>
6. Start an Android Emulator with the following command:
</p>
<p>
<div class="" style="border: 1px solid #969696;text-align:left;background:whitesmoke"><pre><code style="color:rgb(87, 87, 87);background:whitesmoke">
"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
</code></pre></div>
</p>
<p>
7. Run the MAUI app in an Android Simulator.
</p>
<p>
<kbd>dotnet build -t:Run -f net6.0-android</kbd>
</p>
<p>
<img src=images/maui_android.png width="50%" height="50%" />
</p>
<!--
<p>Important Note - The articles aims to provide the easiest and most lucid way of using .NET MAUI with the .NET CLI. Please let me know if there are any steps to remove.</p>
-->
</div>
</article>
</div>
</div>
<div class="col-lg-5 col-xl-4 section-divided__aside section-divided__aside-left group-post">
<!-- Categories-->
<div class="section-md">
<h5>.NET MAUI</h5>
<ul class="list-linked">
<li><a href="twitter.html">#100DAYSOFCODE</a></li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- Page Footer-->
<footer>
<!--
<div class="pre-footer-corporate novi-bg novi-bg-img">
<div class="container">
<div class="row justify-content-sm-center justify-content-lg-start row-30 row-md-60">
<div class="col-sm-10 col-md-6 col-lg-10 col-xl-3">
</div>
<div class="col-sm-10 col-md-6 col-lg-3 col-xl-3">
</div>
<div class="col-sm-10 col-md-6 col-lg-5 col-xl-3">
</div>
<div class="col-sm-10 col-md-6 col-lg-4 col-xl-3">
</div>
</div>
</div>
</div>
-->
<div class="footer-corporate novi-bg novi-bg-img">
<div class="container">
<div class="footer-corporate__inner">
<p class="rights">Copyright MAUIMAN.dev 2021-2023. All rights reserved. </p>
</div>
</div>
</div>
</footer>
</div>
<!-- Global Mailform Output-->
<div class="snackbars" id="form-output-global"></div>
<!-- Javascript-->
<script src="js/core.min.js"></script>
<script src="js/script.js"></script>
</body>
</html>