-
-
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
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?
Because pidRetrySeconds covers it
PID output was trimmed to first digit only.
Co-authored-by: Ivan Dlugos <[email protected]>
Co-authored-by: Ivan Dlugos <[email protected]>
Co-authored-by: Ivan Dlugos <[email protected]>
Co-authored-by: Ivan Dlugos <[email protected]>
Exclude adb tests by path Test Test Remove secrets for adb workflow Fix exclude path Test adb ci test test Revert "test" This reverts commit 85d90f2. Fix PR suggestions fix excluding adb test (require abs path) test Potential fix for code scanning alert no. 135: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Fix Adb test path Add Android build-tools dir to PATH so aapt will be available test
95c591f to
e1a9413
Compare
Co-authored-by: Ivan Dlugos <[email protected]>
| @@ -0,0 +1,64 @@ | |||
| name: Test ADB Provider | |||
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.
Why a separate file? the other one (test-powershell-module.yml) exists just because it's used for multiple modules.
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.
Adb.Tests.ps1 requires setup that’s specific to these integration tests (Android built tools installation, KVM config, emulator-runner action) which would unnecessarily clutter the generic workflow.
| adb wait-for-device | ||
| echo "Android emulator is ready" | ||
| adb devices | ||
| cd ${{ inputs.module-path }} && pwsh -Command "Invoke-Pester Tests/Adb.Tests.ps1 -CI" |
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.
| adb wait-for-device | |
| echo "Android emulator is ready" | |
| adb devices | |
| cd ${{ inputs.module-path }} && pwsh -Command "Invoke-Pester Tests/Adb.Tests.ps1 -CI" | |
| adb wait-for-device | |
| echo "Android emulator is ready" | |
| adb devices | |
| cd ${{ inputs.module-path }} | |
| pwsh -Command "Invoke-Pester Tests/Adb.Tests.ps1 -CI" |
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.
The issue is that each line in the script: block is executed as a separate shell command, so we need to use && to chain them and run everything in a single session.
vaind
left a comment
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.
LGTM with some minor suggestions. Thanks!
Co-authored-by: Ivan Dlugos <[email protected]>

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