Skip to content

Grant location in Wear emulator and add Gibraltar time/GPS scenarios for screenshots#15

Merged
c0d3rb4b4 merged 1 commit into
mainfrom
codex/fix-wearos-screenshot-pipeline-for-location-access
Feb 26, 2026
Merged

Grant location in Wear emulator and add Gibraltar time/GPS scenarios for screenshots#15
c0d3rb4b4 merged 1 commit into
mainfrom
codex/fix-wearos-screenshot-pipeline-for-location-access

Conversation

@c0d3rb4b4
Copy link
Copy Markdown
Owner

Motivation

  • The Wear OS screenshot pipeline was capturing a location-permission denial and sometimes the watch home screen instead of the app, so the workflow must grant location permissions and force in-app launches.
  • The goal is to produce deterministic screenshots showing an eclipse at Gibraltar for two precise UTC times requested.
  • Keep changes localized to the screenshot workflow so runtime app code is untouched.

Description

  • Changed the default deep_links to two targeted scenarios: eclipsetimer://wear/live?scenario=gibraltar-between-c1-c3 and eclipsetimer://wear/live?scenario=gibraltar-max.
  • After installing the APK, grant runtime permissions with adb shell pm grant "$BUNDLE_ID" android.permission.ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION.
  • Disable automatic time/timezone and add helper functions set_emulator_time_utc() and set_emulator_geo_gibraltar() to set the emulator UTC clock and inject GPS via adb emu geo fix (Gibraltar coordinates 36.1408, -5.3536).
  • Per-deep-link handling runs the appropriate scenario setup (sets time + GPS) before launching each deep link, and deep links are launched explicitly against MainActivity with -n "$BUNDLE_ID/$MAIN_ACTIVITY" to keep captures in-app.
  • Removed the initial generic 00-launch.png capture so the pipeline focuses on the two scenario screenshots and updated manifest generation accordingly.

Testing

  • No automated unit/test-suite runs were added or executed because this change only modifies the CI workflow YAML; validate by running the Wear OS Emulator Screenshots workflow to confirm the emulator grants location, applies time/GPS, and produces the two in-app screenshots as expected.

Codex Task

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/wearos-emulator-screenshots.yml
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@c0d3rb4b4 c0d3rb4b4 merged commit 01b86fc into main Feb 26, 2026
9 checks passed
@c0d3rb4b4 c0d3rb4b4 deleted the codex/fix-wearos-screenshot-pipeline-for-location-access branch February 26, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants