Repository navigation
[release/11.0.1xx] [AndroidSdk] Add explicit emulator process environment - #13683
jonathanpeppers merged 1 commit into
Conversation
…ment Manual backport of #13467 (660f039). Preserve release API declarations and existing caller behavior. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the backport adding caller-supplied environment and working-directory settings to emulator launch and AVD listing.
No open issues 🎉
What changed in this PR
Backports #13467 to the release branch, letting Android SDK tooling use a caller-supplied environment and working directory for emulator launch and AVD listing without changing existing constructor behavior.
Changes:
- Adds
EmulatorRunner.CreateWithProcessEnvironmentto snapshot the supplied process settings. - Adds the new API to all three release baselines while preserving existing declarations.
- Tests copied settings and legacy behavior, and moves launch-argument checks into the existing boot test.
| File | Description |
|---|---|
| tests/Xamarin.Android.Tools.AndroidSdk-Tests/EmulatorRunnerTests.cs | Tests environment and directory handling; consolidates argument assertions. |
| src/Xamarin.Android.Tools.AndroidSdk/Runners/EmulatorRunner.cs | Adds the factory and applies copied settings to launch and listing. |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt | Declares the new factory for netstandard2.0. |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net11.0/PublicAPI.Unshipped.txt | Declares the new factory for net11.0. |
| src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net10.0/PublicAPI.Unshipped.txt | Declares the new factory for net10.0. |
Review effort: Balanced
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed 3ac1170a against release/11.0.1xx at 71caa3ae. This is a static, read-only review.
LGTM. This is a faithful backport of #13467. EmulatorRunner.cs here is byte-identical to the #13467 merge commit (660f039) and to current main, and the test changes match upstream.
- The new
static EmulatorRunner.CreateWithProcessEnvironment(string, ProcessStartInfo, Action<TraceLevel,string>? logger = null)declaration matches the implementation exactly in the netstandard2.0, net10.0 and net11.0PublicAPI.Unshipped.txtfiles (line 185). Those are the target frameworks this branch builds. There are no duplicate or Shipped entries, and the main-onlyAdbRunner.CreateWithProcessEnvironmententry was correctly left out. - The environment and working directory are copied when the runner is created and applied to both
LaunchEmulatorandListAvdNamesAsync. The existing constructor path is unchanged, soBootAndroidEmulator(new EmulatorRunner(emulatorPath, logger: logger)) is unaffected. - The consolidated
BootEmulator_AppearsAfterPollingtest keeps the-avd,-no-snapshot-loadand additional-args assertions from the removed tests, and the Unix-only tests keep their[Platform]guards. - The three commits that landed on
release/11.0.1xxsince the merge base don't touch any of these files.
Non-blocking: the removed tests also happened to cover the "emulator launched but never appeared" timeout branch. Upstream made the same trade-off.
Backport of #13467.
Add
EmulatorRunner.CreateWithProcessEnvironmentto copy a caller's complete process environment and working directory for emulator launch and AVD listing. Existing constructor behavior is unchanged.Resolve the PublicAPI conflicts by adding only the new declaration to the release branch's netstandard2.0, net10.0, and net11.0 unshipped baselines. Preserve all existing release declarations. No issue is linked; #13467 is the source PR.
Validation (Windows, SDK 11.0.100):
dotnet test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj --filter FullyQualifiedName~EmulatorRunnerTests -v minimal— passed, 25 tests; exercised the netstandard2.0 library.dotnet test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj --filter FullyQualifiedName~EmulatorRunnerTests -v minimal -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0— passed, 25 tests; exercised the net10.0 library.dotnet test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj --filter FullyQualifiedName~EmulatorRunnerTests -v minimal -p:AndroidToolsDisableMultiTargeting=false -p:DotNetStableTargetFramework=net11.0— passed, 25 tests; exercised the net11.0 library.The two Unix-only tests were skipped on Windows in each run.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: