Make AVD start/delete commands more automation-friendly - #67
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances the AVD (Android Virtual Device) lifecycle commands to be more automation-friendly by adding optional flags that improve resilience and control in CI/cleanup scenarios.
Changes:
- Adds
--forceflag toavd deleteto attempt stopping a running emulator before deletion and suppress all errors (making it safe for cleanup scripts) - Adds
--disable-animationsflag toavd startto disable Android system animations on the emulator for faster UI tests - Adds
--cpu-thresholdflag toavd startto wait for guest CPU load to settle before returning, ensuring system readiness
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AndroidSdk.Tool/AvdDeleteCommand.cs | Adds --force option with error suppression and pre-delete emulator stop logic |
| AndroidSdk.Tool/AvdStartCommand.cs | Adds --disable-animations and --cpu-threshold options with timeout budget management; removes unused System.Linq import |
| AndroidSdk.Tests/CommandSettingsValidation_Tests.cs | Adds validation tests for the new command settings to ensure they pass validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results92 tests 89 ✅ 22m 14s ⏱️ Results for commit 8fd240b. |
Co-authored-by: Copilot <175728472+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.
Why this change matters
AVD lifecycle commands are often used in cleanup and automation paths where resilience is more important than strict failure behavior. This update makes start/delete operations safer and more controllable for CI and local tooling.
What’s included
android avd delete --forceto attempt a stop before delete and treat cleanup failures as non-fatal.android avd start --disable-animationsto reduce runtime animation overhead on launched emulators.android avd start --cpu-thresholdto optionally wait for guest CPU load to settle before proceeding.Validation
dotnet build --configuration Releasedotnet test AndroidSdk.Tests/AndroidSdk.Tests.csproj --configuration Release --filter "FullyQualifiedName~CommandSettingsValidation_Tests"