-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Android support (adb, SauceLabs) #30
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
base: main
Are you sure you want to change the base?
Conversation
| # Intent extras must start with flags: -e, -es, -ez, -ei, -el, -ef, -eu, etc. | ||
| # Followed by at least one whitespace and additional content | ||
| if ($Arguments -notmatch '^-[a-z]{1,2}\s+') { | ||
| throw "Invalid Intent extras format: '$Arguments'. Must start with flags like -e, -es, -ez, -ei, -el, etc. followed by key-value pairs." | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure we really need to moderate this. Other flags should be allowed too. Plus, the canonical way to pass these flags is to use a single - for one-letter options, and -- for things like es, ez, and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a fix for -- arguments in d9e7839, but maybe we could remove this whole validation? Wdyt?
| Write-Debug "DeviceProviderFactory: Creating AndroidAdbProvider" | ||
| return [AndroidAdbProvider]::new() | ||
| } | ||
| "AndroidSauceLabs" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually reviewed yet but one question - do we need android-specific saucelabs provider? I thought the API is the same regardless of iOS/Android.
| "AndroidSauceLabs" { | |
| "SauceLabs" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it will likely be the same for both Android and iOS. I’ve renamed the provider class to SauceLabsProvider but kept the platform-specific names AndroidSauceLabs and iOSSauceLabs since there are still some implementation differences (e.g. app launch, passing input args, etc.). Does that make sense?
Because pidRetrySeconds covers it
PID output was trimmed to first digit only.
|
The problem in the screenshot above seems to have been resolved. |

Summary
Adds Android platform support to
app-runnerenabling application execution on both local Android devices (via ADB) and cloud-based devices (via SauceLabs Real Device Cloud).Architecture
The implementation adds two new providers to the device provider hierarchy allowing to run apps on Android devices:
Key design decisions:
AndroidHelpers.ps1module to reduce duplication across both providersImplementation Details
Core Functionality:
Android-Specific Helpers (AndroidHelpers.ps1):
ConvertFrom-AndroidActivityPath- Parsespackage.name/activity.nameformatTest-IntentExtrasFormat- Validates Intent extras (-e, -es, -ez, etc.)Get-ApkPackageName- Extracts real package names using aapt with filename fallbackFormat-LogcatOutput- Formats logcat for consistent output across providersNote: The iOS-specific implementation in the SauceLabs provider is mostly placeholder code at this point and hasn’t been tested.
Testing
app-runner/Tests/FixturesCI/CD
SAUCE_USERNAME(from repository secrets)SAUCE_ACCESS_KEY(from repository secrets)SAUCE_REGION(hardcoded tous-west-1)Documentation
Usage examples
Requirements
SAUCE_USERNAME,SAUCE_ACCESS_KEY,SAUCE_REGION,SAUCE_DEVICE_NAME,SAUCE_SESSION_NAME- optional)Related PRs