Skip to content

A tap right after lock lock can report success on a locked device #327

Closed

Description

@lana-20

Straight after lock lock, a tap can answer tapped, exit 0, and reach nothing.

Seen on main fe42c5b and af200b6. Android 15 emulator. MobiumApp v1.0.0, home screen. An iPhone 17 Pro simulator (iOS 26.5) never reported a false success in 6 tries.

Repro

$ mobium lock lock
locked (was unlocked)
$ mobium current
dev.mobium.mobiumapp
$ mobium tap "label=Login Demo"
tapped label=Login Demo at (540, 814)
$ mobium lock unlock
unlocked (was locked)
$ mobium find testid=username
No element matches testid=username

Tap outcomes over 8 trials, on each build:

Outcome Exit fe42c5b af200b6
tapped … 0 2 2
the screen could not be read because the device is locked 3 2 3
could not read the UI hierarchy … while the screen was changing 1 4 3

testid=username was absent after unlock in 8/8, so the two reported taps did not open the Login Demo.

Two defects:

  1. A false success. A test or agent carries on as if the tap landed.
  2. Exit 1 names a changing screen, and never the lock. lockedRead gives the right answer in the other trials.

iOS, 6 of 6, on fe42c5b: no element matches label=Login Demo on the current screen — the screen may have changed, run app_map again, exit 4. It is not a false success, though it doesn't mention the lock either, and current still named the app in 5 of the 6.

Possible fix

lock lock answers before the keyguard is up, so the next read still sees the app. Either wait in lockOn until the tree no longer shows the app, or check ScreenLocked before a touch on Android, and in the read-failure path that produced exit 1. I have not built or tested either.

Activity

  1. lana-20 commented on Nov 5, 2026

    @lana-20
    ContributorAuthor

    Verified on main ebab788, Android 15 emulator and iPhone 17 Pro simulator (iOS 26.5).

    Tap right after lock lock Result
    Android exit 3, names the lock, 30 of 30
    iOS exit 3, names the lock, 12 of 12

    The Login Demo was not open after unlock in any of the 42 tries. Unlocked, the same tap works on both platforms.

    Three locked-device cases remain:

    • Android, after input keyevent KEYCODE_SLEEP from outside Mobium: a tap by element reports success, 8 of 8. Name the lock, however an action meets it (CHALLENGES 389) #332 names this limit.
    • iOS: wait label=Login Demo --timeout 2s times out, exit 6, with it is not on screen. It doesn't mention the lock, though tap, scroll-to and others by locator do.
    • iOS: tap 540 814 reports tapped (540, 814), exit 0. That touch does reach the lock screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions