{"id":989,"date":"2026-04-22T09:44:42","date_gmt":"2026-04-22T16:44:42","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/?p=989"},"modified":"2026-04-22T09:44:42","modified_gmt":"2026-04-22T16:44:42","slug":"windows-app-development-cli-v0-3-new-run-and-ui-commands-plus-dotnet-run-support-for-packaged-apps","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/windows-app-development-cli-v0-3-new-run-and-ui-commands-plus-dotnet-run-support-for-packaged-apps\/","title":{"rendered":"Windows App Development CLI v0.3: new run and ui commands, plus dotnet run support for packaged apps"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3.webp\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1023\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3.webp\" alt=\"Header image, reads &quot;Announcing Windows App Development CLI v0.3&quot;\" width=\"2232\" height=\"1166\" srcset=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3.webp 2232w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3-300x157.webp 300w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3-1024x535.webp 1024w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3-768x401.webp 768w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3-1536x802.webp 1536w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/blog-header-0.3-2048x1070.webp 2048w\" sizes=\"(max-width: 2232px) 100vw, 2232px\" \/><\/a><\/p>\n<p>Windows App Development CLI v0.3 is here! This release brings some of our best features yet including a full run-and-debug experience outside Visual Studio and built-in UI Automation from the command line.<\/p>\n<p>With v0.3, we&#8217;ve unlocked a whole class of agentic and automation scenarios. Agents or a script can now <em>run<\/em>, <em>debug<\/em>, <em>see<\/em>, and <em>interact with<\/em>\u00a0a running Windows app \u2014 not just build it.<\/p>\n<p>Whether you&#8217;re building with <strong>WinUI, WPF, WinForms, C++, Electron, Rust, Tauri, Flutter, or Avalonia<\/strong> \u2014 the Windows App Development CLI is for you. It provides the tooling to package, run, add Windows App SDK support, and more to any Windows desktop app. And for <strong>.NET developers<\/strong> in particular, this release makes things even smoother with a <strong>new NuGet package<\/strong> that brings <code>dotnet run<\/code> support for packaged apps right out of the box.<\/p>\n<p>Get the update by running <code>winget install Microsoft.WinAppCli<\/code> or <a href=\"https:\/\/github.com\/microsoft\/winappCli\">check the repo for other install options<\/a>.<\/p>\n<p><div  class=\"d-flex justify-content-left\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/github.com\/microsoft\/winappCli\" target=\"_blank\">Get started with the Windows App Development CLI<\/a><\/div><\/p>\n<p>Let&#8217;s dive in!<\/p>\n<h2>\ud83c\udfc3\u200d\u2642\ufe0f\u200d\u27a1\ufe0f <code>winapp run<\/code>: The Visual Studio F5 experience, anywhere<\/h2>\n<p>Think of <code>winapp run<\/code> as Visual Studio&#8217;s F5 \u2014 but from the command line, and for any packaged app. Give it an unpackaged app folder and a manifest, and it handles the rest: registers a loose package, launches your app, and preserves your <code>LocalState<\/code>\u00a0across re-deploys.<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Build your app, then run it as a packaged app\r\nwinapp run .\/bin\/Debug\r\n<\/code><\/pre>\n<p>It works across the full range of app types we support and comes with a set of modes designed for developers or automated workflows:<\/p>\n<ul>\n<li><code><span style=\"font-family: terminal, monaco, monospace;\"><strong>--detach<\/strong><\/span><\/code>: Launch the app and return control to the terminal immediately. Great for CI\/automation pipelines where you need the app running but don&#8217;t want to block.<\/li>\n<li><code><span style=\"font-family: terminal, monaco, monospace;\"><strong>--unregister-on-exit<\/strong><\/span><\/code>: Automatically cleans up the registered package when the app closes. Perfect for clean test runs where you don&#8217;t want leftover state.<\/li>\n<li><code><span style=\"font-family: terminal, monaco, monospace;\"><strong>--debug-output<\/strong><\/span><\/code>: Captures <code><span style=\"font-family: terminal, monaco, monospace;\">OutputDebugString<\/span><\/code> messages and exceptions in real time. When a crash occurs, a minidump is automatically captured and analyzed in-process. Managed (.NET) crashes are triaged via ClrMD; native (C++\/WinRT) crashes are analyzed via DbgEng. Add <code>--symbols<\/code>\u00a0to download PDBs from the Microsoft Symbol Server for full function names in native stacks.<\/li>\n<\/ul>\n<p>Whether you&#8217;re a developer iterating locally or an agent running end-to-end validation, <code>winapp run<\/code>\u00a0gives you a single command to go from build output to a running, debuggable packaged app.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/winapp-run-gif.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1026\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/winapp-run-gif.gif\" alt=\"winapp run launching AI Dev Gallery\" width=\"2030\" height=\"1382\" \/><\/a><\/p>\n<p>See full usage instructions for <code>winapp run<\/code> at <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/usage.md#run\">WinApp CLI Run Command<\/a>.<\/p>\n<h2>\ud83d\udce6 New NuGet package: <code>Microsoft.Windows.SDK.BuildTools.WinApp<\/code><\/h2>\n<p>We&#8217;re introducing a new NuGet package that enables <code>dotnet run<\/code> to launch packaged .NET apps. It works with WinUI, WPF, WinForms, Console, Avalonia, and more.<\/p>\n<p>With <code>Microsoft.Windows.SDK.BuildTools.WinApp<\/code> configured, <code>dotnet run<\/code> can handle the entire inner loop: it can build your app, prepare a loose-layout package, register it with Windows, and launch \u2014 all in one step. No extra commands, no manual registration. Just <code>dotnet run<\/code>.<\/p>\n<p>Install it directly via NuGet or let <code>winapp init<\/code> set it up for you (which also ensures your <code>.csproj<\/code>\u00a0has all the right properties):<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Option 1: Let winapp init do the work\r\nwinapp init\r\n# Option 2: Install the NuGet package directly\r\ndotnet add package Microsoft.Windows.SDK.BuildTools.WinApp<\/code><\/pre>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/dotnet-run-1.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1025\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/dotnet-run-1.gif\" alt=\"dotnet run launching AI Dev Gallery\" width=\"1440\" height=\"1080\" \/><\/a><\/p>\n<p>For more information on <code>dotnet run<\/code> and the <code>Microsoft.Windows.SDK.BuildTools.WinApp<\/code> NuGet package, check out <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/dotnet-run-support.md\">dotnet run Support for Packaged WinUI Apps<\/a>.<\/p>\n<h2>\ud83d\udda5\ufe0f <code>winapp ui<\/code>: UI Automation from the command line<\/h2>\n<p>UI Automation is now built right into the CLI. <code>winapp ui<\/code> lets you inspect and interact with any running Windows application \u2014 WPF, WinForms, Win32, Electron, WinUI3 \u2014 all from the command line.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/code-snippet.webp\"><img decoding=\"async\" class=\"alignnone wp-image-1043 size-full\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/code-snippet.webp\" alt=\"# List all visible windows winapp ui list-windows -app &quot;My App&quot; # Inspect the UI tree of a running app winapp ui inspect -app &quot;My App&quot; -i # Click a button by name winapp ui click &quot;btn-save-d1&quot; -app &quot;My App&quot; # Take a screenshot winapp ui screenshot -app &quot;My App&quot; -uutput screenshot.png # Find an element winapp ui search &quot;Save&quot; -app &quot;My App&quot; # Set a TextBox value winapp ui set-value &quot;txt-name-a3&quot; &quot;Hello&quot; -app &quot;My App&quot; # Block until element appears winapp ui wait-for &quot;Done&quot; -app &quot;My App&quot; -timeout 10000\" width=\"932\" height=\"263\" srcset=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/code-snippet.webp 932w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/code-snippet-300x85.webp 300w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/code-snippet-768x217.webp 768w\" sizes=\"(max-width: 932px) 100vw, 932px\" \/><\/a><\/p>\n<p>Here&#8217;s what you can do:<\/p>\n<ul>\n<li><strong>List windows<\/strong> \u2014 enumerate all top-level windows on the desktop.<\/li>\n<li><strong>Inspect trees<\/strong>\u00a0\u2014 walk the full UI Automation tree of any window.<\/li>\n<li><strong>Search across windows<\/strong>\u00a0\u2014 find elements by name, type, or automation ID.<\/li>\n<li><strong>Click, invoke, set values<\/strong>\u00a0\u2014 drive the app just like a user would.<\/li>\n<li><strong>Take screenshots<\/strong>\u00a0\u2014 capture individual windows or multi-window composites.<\/li>\n<li><strong>Wait for elements<\/strong>\u00a0\u2014 block until a specific element appears, ideal for test synchronization.<\/li>\n<\/ul>\n<p>This unlocks several new agentic and automation scenarios. Agents or a script are now able to <em>see<\/em> and <em>interact with<\/em> a running app. Combine <code>winapp ui<\/code> with <code>winapp run<\/code>\u00a0for a complete build \u2192 launch \u2192 verify workflow entirely from the terminal \u2014 driven by an agent, a script, or just you.<\/p>\n<p>See full usage instructions for <code>winapp ui<\/code> at <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/usage.md#ui\">WinApp CLI UI Command<\/a>. Also check out our <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/ui-automation.md\">UI Automation Getting Started Guide<\/a>.<\/p>\n<h2>\ud83d\udc1a Shell Completion<\/h2>\n<p>Tab completion is here. Run one command and every <code>winapp<\/code> command, subcommand, and option becomes discoverable right in your terminal with descriptions.<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Set up permanently (PowerShell)\r\nwinapp complete --setup powershell &gt;&gt; $PROFILE\r\n# Try it in the current session\r\nwinapp complete --setup powershell | Out-String | Invoke-Expression<\/code><\/pre>\n<p>Press <code>Tab<\/code> to cycle through commands, or <code>Ctrl+Space<\/code> to see the full list with descriptions. Works for nested commands (<code>winapp cert &lt;Tab&gt;<\/code>) and options (<code>winapp init --c&lt;Tab&gt;<\/code>).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion.webp\"><img decoding=\"async\" class=\"aligncenter wp-image-1011 size-full\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion.webp\" alt=\"Shell completion for winapp cli in terminal. \" width=\"1643\" height=\"744\" srcset=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion.webp 1643w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion-300x136.webp 300w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion-1024x464.webp 1024w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion-768x348.webp 768w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/04\/framed-shell-completion-1536x696.webp 1536w\" sizes=\"(max-width: 1643px) 100vw, 1643px\" \/><\/a><\/p>\n<p>See more information on shell completion at <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/guides\/shell-completion.md\">Shell Completion Guide<\/a>.<\/p>\n<h2>\u26a1 Other notable changes<\/h2>\n<ul>\n<li><strong><code>winapp unregister<\/code><\/strong>: The cleanup counterpart to <code>winapp run<\/code>. Safely removes a sideloaded dev package when you&#8217;re done with it.<\/li>\n<li><strong><code>winapp manifest add-alias<\/code><\/strong>: Adds a <code>uap5:AppExecutionAlias<\/code> to your manifest so a packaged app can be launched by name from the command line. No more hunting for full package family names.<\/li>\n<li><strong><code>Package.appxmanifest<\/code> by default<\/strong>: <code>winapp init<\/code> and <code>winapp manifest generate<\/code> now create a <code>Package.appxmanifest<\/code> file instead of <code>appxmanifest.xml<\/code>. This aligns with the Visual Studio convention and makes it easier to open and edit manifests in VS with the visual manifest editor.<\/li>\n<li><strong>Taskbar icon fix<\/strong>: Fixed a visual bug where a blue plate appeared behind app icons in the taskbar when running with a debug identity.<\/li>\n<\/ul>\n<h2>Get started today<\/h2>\n<p>The Windows App Development CLI is available now in public preview. Visit our <a href=\"https:\/\/github.com\/microsoft\/WinAppCli\">GitHub repository<\/a>\u00a0for documentation, guides, and to file issues.<\/p>\n<p>We would love to hear your feedback!<\/p>\n<h3>To get started:<\/h3>\n<p><strong>Install via WinGet:<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">winget install Microsoft.WinAppCli<\/code><\/pre>\n<p><strong>Install via npm:<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">npm install -g @microsoft\/winappcli<\/code><\/pre>\n<p>Check out our <a href=\"https:\/\/github.com\/microsoft\/WinAppCli\/blob\/main\/docs\/guides\/dotnet.md\">.NET<\/a>, <a href=\"https:\/\/github.com\/microsoft\/WinAppCli\/blob\/main\/docs\/guides\/cpp.md\">C++\/CMake<\/a>, <a href=\"https:\/\/github.com\/microsoft\/WinAppCli\/blob\/main\/docs\/electron-get-started.md\">Electron<\/a>, <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/guides\/rust.md\">Rust<\/a> or <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/guides\/flutter.md\">Flutter<\/a> guides for getting started quickly.<\/p>\n<p>Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows App Development CLI v0.3 is here! This release brings some of our best features yet including a full run-and-debug experience outside Visual Studio and built-in UI Automation from the command line. With v0.3, we&#8217;ve unlocked a whole class of agentic and automation scenarios. Agents or a script can now run, debug, see, and interact [&hellip;]<\/p>\n","protected":false},"author":110839,"featured_media":1023,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,71],"tags":[4,80,17,79,49,8,78,6,7,44],"class_list":["post-989","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ifdef-windows","category-windows-app-development-cli","tag-net","tag-agents","tag-ai","tag-cli","tag-dotnet","tag-windows","tag-windows-apps","tag-winui","tag-winui3","tag-wpf"],"acf":[],"blog_post_summary":"<p>Windows App Development CLI v0.3 is here! This release brings some of our best features yet including a full run-and-debug experience outside Visual Studio and built-in UI Automation from the command line. With v0.3, we&#8217;ve unlocked a whole class of agentic and automation scenarios. Agents or a script can now run, debug, see, and interact [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts\/989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/users\/110839"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/comments?post=989"}],"version-history":[{"count":2,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts\/989\/revisions"}],"predecessor-version":[{"id":1048,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts\/989\/revisions\/1048"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/media\/1023"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/media?parent=989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/categories?post=989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/tags?post=989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}