docs-maui icon indicating copy to clipboard operation
docs-maui copied to clipboard

Add Android CLI build and deployment documentation

Open Copilot opened this issue 5 months ago • 32 comments

  • [x] Fix MD029 markdownlint issues by removing disable/enable comments and fixing root cause
  • [x] Update all net8.0-android references to net10.0-android per feedback
  • [x] Replace AndroidDeviceUsb with AdbTarget property (official .NET 10 property)
  • [x] Update from dotnet build -t:Run to dotnet run (official .NET 10 approach)
  • [x] Document proper adb flags: -d (device), -e (emulator), -s (specific)
  • [x] Add reference to adb documentation for additional command-line options
  • [x] Add version notes for dotnet run support and legacy command usage
  • [x] Move version note to appear immediately after the command usage
  • [x] Revert .gitignore changes per feedback

Summary

This PR adds comprehensive Android CLI documentation matching the iOS CLI documentation structure. Key features include:

New Documentation File: docs/android/cli.md

  • Complete setup instructions for .NET MAUI Android development
  • Basic build and run commands using dotnet run -f net10.0-android
  • Detailed instructions for targeting specific emulators when multiple are running
  • Physical device deployment guidance
  • Advanced CLI options and MSBuild properties
  • Version compatibility notes for dotnet run support (.NET 10+) and legacy command usage (.NET 9 and earlier)

Key Commands Documented:

# Run on the only running emulator (.NET 10+)
dotnet run -f net10.0-android -p:AdbTarget=-e

# Run on the only attached physical device (.NET 10+)
dotnet run -f net10.0-android -p:AdbTarget=-d

# Target a specific emulator or device (.NET 10+)
dotnet run -f net10.0-android -p:AdbTarget="-s emulator-5554"

# Legacy command for .NET 9 and earlier
dotnet build -t:Run -f net9.0-android

Navigation Updates: Added the new CLI documentation to TOC.yml in the Android section, positioned consistently with the iOS CLI documentation.

The documentation uses the officially supported AdbTarget property (documented in .NET 10 what's new) which maps directly to adb command-line arguments, providing a clean and standard interface for device and emulator targeting.

Fixes #2936.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File 🔗 Preview link
docs/android/cli.md docs/android/cli

Copilot avatar Sep 21 '25 18:09 Copilot