Skip to content

Unify Android run targets - #12906

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-unify-android-run
Sep 25, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-unify-android-run

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • keep Run, _AndroidAdbToolPath, and run-argument computation in Microsoft.Android.Sdk.Application.targets
  • route dotnet build -t:Run through Microsoft.Android.Run with non-waiting launch behavior while still waking the device
  • build before installing when Run is invoked directly, matching dotnet run's build/deploy ordering
  • retain StartAndroidActivity as a compatibility alias for Run
  • remove the legacy private _Run target and RunActivity task implementation
  • update run-target documentation and test coverage

Validation

  • built Xamarin.Android.Build.Debugging.Tasks successfully
  • built Xamarin.Android.Build.Tasks successfully
  • built MSBuildDeviceIntegration successfully
  • ran BuildOrderTests.ComputeRunArgumentsIncludesDebuggerPortForwarding successfully
  • verified Run emits --no-wait without --no-wake-device
  • verified explicit WaitForExit=false retains both --no-wait and --no-wake-device
  • analyzed the RunTargetRespectsAndroidDeviceUserId CI binlog: the failure occurred before Microsoft.Android.Run launched because Install attempted assembly resolution before UnnamedProject.dll existed; adding Build before Install fixes that target ordering

Copilot AI lite review requested due to automatic review settings September 23, 2026 21:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical target availability and debugger setup issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Unifies Android app launching through Microsoft.Android.Run, updates debugging/profiling integration, and removes the legacy run task.

Changes:

  • Adds unified run behavior with wake/no-wait semantics.
  • Preserves StartAndroidActivity compatibility and updates debugging routes.
  • Updates tests, resources, and documentation.
File Summary
tests/​MSBuildDeviceIntegration/​Tests/​InstallAndRunTests.cs Tests unified run behavior; alias coverage remains a nit (1 vote).
src/​Xamarin.AndroidTools/​Debugging/​ExecutionConfiguration.cs Updates debugging documentation.
src/​Xamarin.Android.Build.Tasks/​Xamarin.Android.Application.targets Adds compatibility alias; critical legacy-project target issue remains (4 votes).
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​BuildOrderTests.cs Tests run argument generation.
src/​Xamarin.Android.Build.Tasks/​Microsoft.Android.Sdk/​targets/​Microsoft.Android.Sdk.Application.targets Defines Run; moderate debugger setup/cleanup issue remains (1 vote).
src/​Xamarin.Android.Build.Debugging.Tasks/​Xamarin.Android.Common.Debugging.targets Removes legacy run path and updates native debugging.
src/​Xamarin.Android.Build.Debugging.Tasks/​Tasks/​RunActivity.cs Removes obsolete task implementation.
src/​Xamarin.Android.Build.Debugging.Tasks/​Properties/​Resources.resx Removes unused resource.
src/​Xamarin.Android.Build.Debugging.Tasks/​Properties/​Resources.Designer.cs Removes generated resource accessor.
Documentation/​docs-mobile/​building-apps/​build-targets.md Documents unified run and alias behavior.
Files not reviewed (1)
  • src/Xamarin.Android.Build.Debugging.Tasks/Properties/Resources.Designer.cs: Generated file

Comment thread src/Xamarin.Android.Build.Tasks/Xamarin.Android.Application.targets
@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers-unify-android-run branch 2 times, most recently from 8e87cd4 to d7fdb29 Compare September 24, 2026 20:39
Route direct Run and StartAndroidActivity invocations through Microsoft.Android.Run, and remove the legacy RunActivity implementation.

Co-authored-by: Copilot App <[email protected]>
@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers-unify-android-run branch from d7fdb29 to 6c13be6 Compare September 24, 2026 20:44
@jonathanpeppers
jonathanpeppers added this pull request to stack #12917 September 24, 2026 21:19
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Sep 25, 2026
@jonathanpeppers

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12906

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Needs Changes — 2 errors.

The target consolidation and focused run-argument coverage are useful, and all reported CI checks are green. However, replacing RunActivity with Microsoft.Android.Run preserves adb port forwarding but drops the device-side managed-debugger setup and cleanup. That breaks both debugger-attached launches and the isolation of subsequent non-debug launches; the inline comments identify the two behaviors that need to be retained.

Generated by Android PR Reviewer for #12906 · copilot · gpt56 · 130 AIC · ⌖ 11.2 AIC · ⊞ 25.9K
Comment /review to run again

@jonathanpeppers
jonathanpeppers merged commit 6ae5737 into main Sep 25, 2026
44 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-unify-android-run branch September 25, 2026 15:26
jonathanpeppers added a commit that referenced this pull request Sep 30, 2026
- Migrate debugging-task device selection, ABI lookup, FastDeploy and app-detection to in-tree Android SDK tooling; remove the debugging tasks' project references to `Xamarin.AndroidTools` and `Mono.AndroidTools`.
- Remove `GetGdbSymbols`, `ResolveXamarinAndroidTools`, and obsolete GDB debugging targets; retain `_ResolveXamarinAndroidTools` as a compatibility target for existing MSBuild dependencies.
- Leave installer-side consumers and the legacy projects unchanged. The parent PR (#12906) removes `RunActivity`.

Co-authored-by: Copilot App <[email protected]>
jonathanpeppers added a commit that referenced this pull request Oct 1, 2026
## Summary

- Remove the `Mono.AndroidTools` and `Xamarin.AndroidTools` projects and their compiled assemblies from the workload SDK pack.
- Migrate installer SDK/JDK discovery and macOS directory-size process execution to `Xamarin.Android.Tools.AndroidSdk`, preserving first-time installation when the SDK or JDK is absent.
- Remove obsolete solution, build, packaging, and localization references; add installer discovery regression coverage.

**Breaking change:** Tools referencing `Mono.AndroidTools.dll` or `Xamarin.AndroidTools.dll` directly must migrate to the supported shared Android SDK tooling APIs. Generated non-English `.resx` files under `src/Xamarin.AndroidTools/Properties/` remain untouched per repository localization policy; they are not compiled or packaged.

Stacked on #12916 (which follows merged #12906).

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants