-
Notifications
You must be signed in to change notification settings - Fork 31
Add AvdManagerRunner for avdmanager CLI operations #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rmarinho
wants to merge
39
commits into
main
Choose a base branch
from
feature/avdmanager-runner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
10da27d
Add AndroidEnvironmentHelper for SDK tool environment setup
rmarinho d1e0381
Convert AndroidEnvironmentHelper to file-scoped namespace, fix indent…
rmarinho 64c31d5
Add shared ConfigureEnvironment(PSI), use EnvironmentVariableNames co…
rmarinho d5f23bd
Add AdbRunner for adb CLI operations
rmarinho 53db30d
Refactor AdbRunner per copilot instructions
rmarinho bd51750
Fix indentation: add tab indentation per Mono coding guidelines
rmarinho d058501
Add ANDROID_HOME environment and WaitForDeviceAsync
rmarinho e7e4504
Trim verbose XML docs, make AdbPath internal
rmarinho da70f75
Refactor AdbRunner: extract CreateAdbProcess helper, add serial valid…
rmarinho 8b0c25d
Make AdbPath public for consumer access
rmarinho 1cab277
Convert AdbRunner and AdbDeviceInfo to file-scoped namespaces, add us…
rmarinho d3c4a78
Use shared ConfigureEnvironment, ProcessUtils.CreateProcessStartInfo,…
rmarinho d41ad12
Port device listing logic from dotnet/android GetAvailableAndroidDevices
rmarinho 2c8d29c
Make parsing/formatting methods public for dotnet/android consumption
rmarinho 95c02f1
Fix: re-throw OperationCanceledException in GetEmulatorAvdNameAsync
rmarinho a1df9f9
Add EmulatorRunner for emulator CLI operations
rmarinho 852b1dc
Refactor EmulatorRunner per copilot instructions
rmarinho f6c49de
Fix indentation: add tab indentation per Mono coding guidelines
rmarinho 9f2629c
Add JAVA_HOME and ANDROID_HOME environment support
rmarinho fe493f1
Trim verbose XML docs, make EmulatorPath internal
rmarinho 3285c0a
Make EmulatorPath public for consumer access
rmarinho 19e5f46
Convert EmulatorRunner to file-scoped namespace, add using on StringW…
rmarinho 463acb6
Use shared ConfigureEnvironment, ProcessUtils.CreateProcessStartInfo,…
rmarinho 5ecd99b
Add AvdManagerRunner for avdmanager CLI operations
rmarinho 62a4858
Refactor AvdManagerRunner per copilot instructions
rmarinho 77e8101
Fix indentation: add tab indentation per Mono coding guidelines
rmarinho dd654e8
Add JAVA_HOME support, CreateAvdAsync, and orphaned AVD handling
rmarinho a7f2865
Trim verbose XML docs, make AvdManagerPath internal
rmarinho def84fd
Make AvdManagerPath public for consumer access
rmarinho db6284c
Add using on StringWriters, add ParseAvdListOutput unit tests
rmarinho f19fc26
Convert to file-scoped namespaces, remove tracked nupkg
rmarinho e94bfbf
Address review: versioned path discovery, CreateProcessStartInfo, Env…
rmarinho 758a612
Use shared ConfigureEnvironment, add path discovery tests
rmarinho 620e530
Address PR #282 review feedback
rmarinho e818313
Remove unused using System.Collections.Generic
rmarinho f163274
Add shared helpers: ThrowIfFailed, ValidateNotNullOrEmpty, FindCmdlin…
rmarinho 271b5c1
Use shared helpers in AvdManagerRunner
rmarinho 37c3a79
Address PR #282 review feedback: exit codes, type splitting, structur…
rmarinho d96296a
Refactor AvdManagerRunner: resolved path constructor, pattern matchin…
rmarinho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceInfo.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Xamarin.Android.Tools; | ||
|
|
||
| /// <summary> | ||
| /// Represents an Android device or emulator from 'adb devices -l' output. | ||
| /// Mirrors the metadata produced by dotnet/android's GetAvailableAndroidDevices task. | ||
| /// </summary> | ||
| public class AdbDeviceInfo | ||
| { | ||
| /// <summary> | ||
| /// Serial number of the device (e.g., "emulator-5554", "0A041FDD400327"). | ||
| /// For non-running emulators, this is the AVD name. | ||
| /// </summary> | ||
| public string Serial { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Human-friendly description of the device (e.g., "Pixel 7 API 35", "Pixel 6 Pro"). | ||
| /// </summary> | ||
| public string Description { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Device type: Device or Emulator. | ||
| /// </summary> | ||
| public AdbDeviceType Type { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Device status: Online, Offline, Unauthorized, NoPermissions, NotRunning, Unknown. | ||
| /// </summary> | ||
| public AdbDeviceStatus Status { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// AVD name for emulators (e.g., "pixel_7_api_35"). Null for physical devices. | ||
| /// </summary> | ||
| public string? AvdName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Device model from adb properties (e.g., "Pixel_6_Pro"). | ||
| /// </summary> | ||
| public string? Model { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Product name from adb properties (e.g., "raven"). | ||
| /// </summary> | ||
| public string? Product { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Device code name from adb properties (e.g., "raven"). | ||
| /// </summary> | ||
| public string? Device { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Transport ID from adb properties. | ||
| /// </summary> | ||
| public string? TransportId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether this device is an emulator. | ||
| /// </summary> | ||
| public bool IsEmulator => Type == AdbDeviceType.Emulator; | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceStatus.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Xamarin.Android.Tools; | ||
|
|
||
| /// <summary> | ||
| /// Represents the status of an Android device. | ||
| /// </summary> | ||
| public enum AdbDeviceStatus | ||
| { | ||
| Online, | ||
| Offline, | ||
| Unauthorized, | ||
| NoPermissions, | ||
| NotRunning, | ||
| Unknown | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceType.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Xamarin.Android.Tools; | ||
|
|
||
| /// <summary> | ||
| /// Represents the type of an Android device. | ||
| /// </summary> | ||
| public enum AdbDeviceType | ||
| { | ||
| Device, | ||
| Emulator | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Xamarin.Android.Tools; | ||
|
|
||
| public class AvdInfo | ||
| { | ||
| public string Name { get; set; } = string.Empty; | ||
| public string? DeviceProfile { get; set; } | ||
| public string? Path { get; set; } | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.