Grant location in Wear emulator and add Gibraltar time/GPS scenarios for screenshots#15
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the Wear OS emulator screenshot workflow to capture deterministic eclipse screenshots at Gibraltar by granting location permissions, controlling emulator time/GPS, and ensuring in-app captures.
Changes:
- Updated default deep links to two Gibraltar eclipse scenarios with query parameters for specific eclipse phases
- Added location permission grants and time/GPS control functions to set emulator state before each screenshot
- Modified deep link launching to explicitly target MainActivity and removed the generic launch screenshot
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dad71a9872
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| compact_utc="$(printf '%s' "$iso_utc" | tr -d ':-' | sed -E 's/T/./; s/Z$//')" | ||
| fi | ||
|
|
||
| adb -s "$emulator_serial" shell "date -u $compact_utc" >/dev/null 2>&1 || true |
There was a problem hiding this comment.
Fail when emulator clock override does not apply
This command masks failures from adb shell date, so on emulator images where shell time changes are rejected or the format is invalid, the workflow still succeeds and captures screenshots at the wrong instant. Because no later check validates the applied clock, the produced Gibraltar scenario artifacts can silently be incorrect while the run appears green.
Useful? React with 👍 / 👎.
| set_emulator_geo_gibraltar() { | ||
| local lat="36.1408" | ||
| local lon="-5.3536" | ||
| adb -s "$emulator_serial" emu geo fix "$lon" "$lat" >/dev/null 2>&1 || true |
There was a problem hiding this comment.
Surface GPS injection failures before taking screenshots
The GPS fix is also wrapped with || true, so if adb emu geo fix is unavailable or fails for the selected emulator, captures continue with stale/default coordinates. Since the workflow then packages and uploads screenshots without verifying location, this can silently invalidate the intended Gibraltar-specific output.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
Description
deep_linksto two targeted scenarios:eclipsetimer://wear/live?scenario=gibraltar-between-c1-c3andeclipsetimer://wear/live?scenario=gibraltar-max.adb shell pm grant "$BUNDLE_ID" android.permission.ACCESS_FINE_LOCATIONandACCESS_COARSE_LOCATION.set_emulator_time_utc()andset_emulator_geo_gibraltar()to set the emulator UTC clock and inject GPS viaadb emu geo fix(Gibraltar coordinates36.1408, -5.3536).MainActivitywith-n "$BUNDLE_ID/$MAIN_ACTIVITY"to keep captures in-app.00-launch.pngcapture so the pipeline focuses on the two scenario screenshots and updated manifest generation accordingly.Testing
Wear OS Emulator Screenshotsworkflow to confirm the emulator grants location, applies time/GPS, and produces the two in-app screenshots as expected.Codex Task