Skip to content

Document how to drive the app on a device without popups - #710

Merged
kasnder merged 2 commits into
masterfrom
docs/agent-device-testing
Aug 5, 2026
Merged

Document how to drive the app on a device without popups#710
kasnder merged 2 commits into
masterfrom
docs/agent-device-testing

Conversation

@kasnder

@kasnder kasnder commented Aug 5, 2026

Copy link
Copy Markdown
Member

Independent of the #704 stack — docs only, no code.

Why

Agent sessions kept burning turns tapping through onboarding, the VPN consent dialog and the runtime permission prompts, then landing back in onboarding after overwriting the preferences file (which drops onboarding_version). None of that is necessary.

What

A new subsection under §3's Connected-device testing, covering the adb-only setup:

  • adb install -r -g for runtime permissions — with the caveat that -g grants the permission you are testing too, so revoke it explicitly or checkSelfPermission will lie.
  • adb shell appops set <pkg> ACTIVATE_VPN allow, which makes VpnService.prepare() return null. That skips both the system ConfirmDialog and TrackerControl's own explainer in front of it.
  • Seeding onboarding_version, which run-as can write before the first launch.

Plus the traps behind most of the churn:

  • force-stop before editing preferences, or the running process overwrites your file on exit;
  • merge rather than replace, so onboarding_version survives;
  • adb uninstall / pm clear wipe the seeded prefs, the appop and the grants together.

And two things that matter on someone's personal device:

  • VpnService.prepare() revokes whatever VPN app currently holds consent — the maintainer's own build, or their real VPN. Worth saying out loud before enabling a tunnel.
  • Read notifications with dumpsys notification --noredact rather than screenshotting the shade, which captures the user's private notifications.

Two standing rules changed

Connected-device testing now defaults to fdroid debug. github debug installs as net.kollnig.missioncontrol.test — the same package as a maintainer's day-to-day dev build. The old advice meant testing on top of their real configuration, and enabling that build's VPN takes the consent slot from whatever they were running. The flavours differ only in the update-check API, so net.kollnig.missioncontrol.fdroid.test costs nothing and installs alongside. github remains the flavour for building and compile checks; only device work moves.

Destroying state now requires asking. The previous wording said not to uninstall or pm clear "unless the user explicitly requests a clean install"; it now states the rule directly and extends it to overwriting preferences and revoking permissions, and to targets that look like a throwaway you installed yourself — that case is one mistaken package name away from the real install.

Both changes come from a live session where I got this wrong: I uninstalled a debug build repeatedly for cleanup without asking, and revoked the maintainer's VPN consent without warning first.

Testing

Verified verbatim on a Pixel 8 (Android 17), from a clean install of the fdroid debug build: the app lands directly on ActivityMain, the VPN switch brings the tunnel up with no dialogs at all, and the permission under test stays denied.

kasnder and others added 2 commits August 5, 2026 11:00
Agent sessions kept burning turns tapping through onboarding, the VPN
consent dialog and permission prompts — and re-entering onboarding after
overwriting the preferences file, which drops onboarding_version.

All of it can be pre-satisfied from adb, with no code changes and
nothing debug-only to maintain: `install -g` for runtime permissions,
`appops set ACTIVATE_VPN allow` so VpnService.prepare() returns null
(which skips the system dialog and our own explainer before it), and a
seeded onboarding_version, which run-as can write before the first
launch.

Also records the traps behind the churn: force-stop before editing
preferences or the running process overwrites them, merge rather than
replace so onboarding_version survives, and uninstall/pm clear wipe the
seeded state along with the appop and the grants.

Two notes for someone else's device: VpnService.prepare() revokes
whatever VPN app currently holds consent, and the github debug package
is also what a maintainer's own dev build installs as, so seeding
preferences into it overwrites their real configuration.

Verified end to end on a Pixel 8 (Android 17).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…troying state

github debug installs as net.kollnig.missioncontrol.test, which is also
what a maintainer's own day-to-day dev build installs as. Following the
previous advice meant testing on top of their real configuration, and
enabling its VPN takes the consent slot from whatever they were running.
The flavours differ only in the update-check API, so fdroid debug costs
nothing and installs alongside.

Also states the rule the previous wording only implied: uninstall,
pm clear, overwriting preferences and revoking permissions are
irreversible, so ask first and name what will be lost — including when
the target looks like a throwaway you installed yourself, since that is
one mistaken package name away from the real install.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kasnder
kasnder merged commit 36b6311 into master Aug 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant