Skip to content

fix: lock screen via IOHID Power press on iOS 27#1171

Merged
KazuCocoa merged 1 commit into
appium:masterfrom
agrim0312:fix-lock-device-via-HID-event
Jul 12, 2026
Merged

fix: lock screen via IOHID Power press on iOS 27#1171
KazuCocoa merged 1 commit into
appium:masterfrom
agrim0312:fix-lock-device-via-HID-event

Conversation

@agrim0312

Copy link
Copy Markdown

Problem

On iOS 27, [XCUIDevice pressLockButton] no longer locks the screen. It routes
through testmanagerd, which waits on a ButtonEventsCompleted confirmation
that iOS 27 never fires — so it times out and never locks, and POST /wda/lock
fails with Timed out while waiting until the screen gets locked.

testmanagerd : Timed out after waiting 5.0s for ButtonEventsCompleted,
event will be implicitly confirmed with no error other than this log message.

Fix

On iOS 27+, lock via a direct IOHID Power press (fb_performIOHIDEventWithPage:,
page 0x0C / usage 0x30, 0.5s) instead of pressLockButton. Older iOS is
unchanged. The existing FBRunLoopSpinner wait on the
com.apple.springboard.lockstate notification stays, so success is still
confirmed by the screen actually locking. Scoped to fb_lockScreen:.

Testing

Verified on a physical iOS 27 device: unlocked (/wda/lockedfalse),
POST /wda/lock returned 200 in ~2s (no timeout), /wda/lockedtrue.

Syslog on the fixed path — the injected event (page 12/usage 48 = 0x0C/0x30,
0.50s) is confirmed cleanly and the device locks:

SpringBoard   performSleep: locking the device with lock button source
testmanagerd  Event <XCDeviceEvent page 12 usage 48 duration 0.50s> confirmed by ButtonEventsCompleted.
identityservicesd System did lock
SpringBoard   UILocked: 1
coreauthd     Did receive notification com.apple.springboard.lockstate```

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 11, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: agrim0312 / name: agrim0312 (4eee26b)

@KazuCocoa

Copy link
Copy Markdown
Member

The change lg. Could you sign the CLA as well? @agrim0312

@agrim0312

Copy link
Copy Markdown
Author

The change lg. Could you sign the CLA as well? @agrim0312

Yup, done !!

@KazuCocoa

KazuCocoa commented Jul 11, 2026

Copy link
Copy Markdown
Member

The CLA is linked to the git commit's email address. It might be different from your signed email cc @agrim0312

@agrim0312

Copy link
Copy Markdown
Author

The CLA is linked to the git commit's email address. It might be different from your signed email cc @agrim0312

You're right — when I opened this PR, my commit's author email was tied to a CLA signed under a different email than the one associated with this account. After seeing the CLA check fail, I've now re-signed the CLA using the email linked to @agrim0312.

Could you please advise on the next steps to get the check to pass?
cc: @KazuCocoa

@KazuCocoa

Copy link
Copy Markdown
Member

Either may work:

  1. Re-create the same change with your expected email's git commit
  2. git commit --amend --author="Your Name <new_email@example.com>" --no-edit - it will change your latest commit's author info

@agrim0312 agrim0312 force-pushed the fix-lock-device-via-HID-event branch from b2f10a9 to 4eee26b Compare July 12, 2026 05:40
@agrim0312

Copy link
Copy Markdown
Author

Either may work:

  1. Re-create the same change with your expected email's git commit
  2. git commit --amend --author="Your Name <new_email@example.com>" --no-edit - it will change your latest commit's author info

Thanks a lot, @KazuCocoa! 🙏 That did the trick — I amended the commit to use the email my CLA is signed under (there was a small typo in the original author email) and force-pushed. The CLA check is passing now.

Appreciate you pointing me in the right direction.

@KazuCocoa KazuCocoa merged commit 64be238 into appium:master Jul 12, 2026
42 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 12, 2026
## [15.1.5](v15.1.4...v15.1.5) (2026-07-12)

### Bug Fixes

* lock screen via IOHID Power press on iOS 27 ([#1171](#1171)) ([64be238](64be238))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 15.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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