Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new “runner” infrastructure and an AdbRunner wrapper intended to simplify invoking Android SDK command-line tools (notably adb) from Xamarin.Android.Tools.AndroidSdk.
Changes:
- Introduces
AndroidToolRunner+ToolRunnerResultmodels for executing tools with captured output, timeouts, and cancellation. - Adds
AndroidEnvironmentHelperutilities for env var setup and some Android mapping helpers. - Adds
AdbRunnerfor listing devices, waiting for boot completion, emulator control, and property enrichment.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Tools.AndroidSdk/Runners/AndroidToolRunner.cs | New process execution helper (sync/async/timeout/background). |
| src/Xamarin.Android.Tools.AndroidSdk/Runners/AndroidEnvironmentHelper.cs | New helper for tool env vars and mapping helpers. |
| src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbRunner.cs | New adb wrapper for device/emulator operations and parsing. |
| src/Xamarin.Android.Tools.AndroidSdk/Models/ToolRunnerResult.cs | New execution result model (+ generic variant). |
| src/Xamarin.Android.Tools.AndroidSdk/Models/AndroidDeviceInfo.cs | New device model + enums used by AdbRunner. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AndroidEnvironmentHelper.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Tools.AndroidSdk/Runners/AndroidToolRunner.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Tools.AndroidSdk/Runners/AndroidToolRunner.cs
Outdated
Show resolved
Hide resolved
Member
|
I'd like to get the System.Diagnostics.Process code unified like mentioned here: |
rmarinho
added a commit
that referenced
this pull request
Feb 24, 2026
Addresses PR #283 feedback to use existing ProcessUtils instead of the removed AndroidToolRunner. Simplifies API: - Methods now throw InvalidOperationException on failure - Uses ProcessUtils.RunToolAsync() for all tool invocations - Added AndroidDeviceInfo model - Removed complex ToolRunnerResult wrapper types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bb947a5 to
b08dd3f
Compare
rmarinho
added a commit
that referenced
this pull request
Feb 24, 2026
Addresses PR #283/#284 feedback to use existing ProcessUtils. Simplifies API by throwing exceptions on failure instead of returning result types with error states. Changes: - AdbRunner: Simplified using ProcessUtils.RunToolAsync() - EmulatorRunner: Uses ProcessUtils.StartToolBackground() - Removed duplicate AndroidDeviceInfo from Models directory Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
124c3c9 to
f0ebb8d
Compare
- ListDevicesAsync(): List connected devices - StopEmulatorAsync(): Stop a running emulator Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add XML documentation to all public members - Split AdbDeviceInfo into its own file (one type per file) - Use 'is not null' instead of '!= null' - Improve code formatting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ConfigureEnvironment() sets ANDROID_HOME on all ProcessStartInfo - Add WaitForDeviceAsync with optional serial filter, timeout, and TimeoutException - Uses CancellationTokenSource.CreateLinkedTokenSource for timeout handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ation, reduce duplication - Extract RequireAdb() to centralize availability check - Extract CreateAdbProcess() to eliminate PSI creation duplication - Add whitespace validation on serial parameter in StopEmulatorAsync - Use params string[] args pattern for cleaner argument passing - Remove redundant XML doc comments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6849f83 to
d3046c1
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Wraps
adbCLI operations for device management. Addresses #279.Changes
New: ConfigureEnvironment
Sets ANDROID_HOME on all child process ProcessStartInfo.
New: WaitForDeviceAsync
Updated: ListDevicesAsync / StopEmulatorAsync
Now call ConfigureEnvironment(psi) to set ANDROID_HOME.
API