Repository navigation
[Xamarin.Android.Build.Tasks] Skip RID-inner device checks - #13304
Merged
Merged
Conversation
Keep device boot checks in outer builds and skip publish-only RID inner builds, matching the ABI query condition. Add three target-order regression cases. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change that skips redundant device boot checks in publish-only RID inner builds.
No open issues 🎉
What changed in this PR
This PR avoids redundant device boot checks in .NET for Android publish-only runtime identifier (RID) inner builds while preserving outer-build device preparation.
Changes:
- Skip
_EnsureDeviceBootedwhen_ComputeFilesToPublishForRuntimeIdentifiersistrue. - Preserve the outer-build ABI hook and explicit deployment/run-argument dependencies.
- Add three regression cases covering inner builds, outer builds with an explicit RID and ADB target, and empty device selection.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildOrderTests.cs |
Adds regression coverage for device boot conditions and ordering before the ABI query. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets |
Adds and documents the publish-only RID inner-build guard. |
Review effort: Balanced
simonrozsival
approved these changes
Oct 28, 2026
3 tasks done
jonathanpeppers
added a commit
that referenced
this pull request
Nov 23, 2026
…uilds (#13304) (#13731) Backport of #13304. Skip the `_EnsureDeviceBooted` target when `$(_ComputeFilesToPublishForRuntimeIdentifiers)` is `true`, so publish-only RID inner builds do not repeat the outer build's device boot check. Add the `DeviceBootIsLimitedToOuterBuilds` regression test. Conflict resolution: `BuildOrderTests.cs` on main contains other tests that are not on this branch. Only the new test and its `using` lines were kept. (cherry picked from commit dc2dd52) Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small C# change followed by
dotnet run -blrepeated<BootAndroidEmulator/>in publish-only RID inner builds, although<GetPrimaryCpuAbi/>already skips its device query there.Skip the
_EnsureDeviceBootedtarget when$(_ComputeFilesToPublishForRuntimeIdentifiers)istrue. Keep the outer-build ABI hook and the explicit deployment/run-argument dependencies. Add three regression cases toBuildOrderTestsfor inner builds, outer builds with an explicit RID and ADB target, and an empty device selection.A before/after incremental deploy and launch on an online Pixel 10 confirmed:
Both runs compiled one C# change and launched successfully, confirmed by process-specific logcat markers. The MT build used
-m -mt -nr:false -warnaserror:MSB4286,MSB4287,MSB4288with no MT safety warnings or errors. The ordinary CLI API calls are not counted as MT work. The probe used this worktree's rebuilt SDK12.0.100-alpha.1.26523.103; no elapsed-time improvement is claimed.Validation:
.\dotnet-local.cmd build Microsoft.Android.slnx -nodeReuse:false -v:quiet— passed after rebase, with existing warnings..\dotnet-local.cmd build Microsoft.Android.slnx -t:PackDotNet -nodeReuse:false -v:quiet— passed after rebase, with existing warnings..\dotnet-local.cmd test bin\TestDebug\net10.0\Xamarin.Android.Build.Tests.dll --filter FullyQualifiedName~BuildOrderTests— all 7 passed after rebase, withTEST_ANDROID_JDK_PATH=D:\android-toolchain\jdk-21..\dotnet-local.cmd test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj -v minimal --filter FullyQualifiedName~EmulatorRunnerTests -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0— all 25 passed.Live emulator startup and multiple-device scenarios were not rerun; the runner behavior is unchanged.