# Check status before unlockingstatus = client.status()if status.screen_locked: phone.unlock(passcode="123456") time.sleep(0.5) # Wait for unlock animation# Now interact with the devicephone.open_app("Safari")
Remember that iOS will auto-lock the device after a period of inactivity. For long-running scripts, periodically interact with the device or check lock status.
Failed unlock attempts
iOS limits incorrect passcode attempts. Be careful with automated unlock attempts to avoid triggering security lockouts.