YueChen-C / py-ios-device

IOS Professional Performance Testing Tool . You can get CPU, GPU, Memory , Lifecycle and other metrics from real iOS devices . IOS 专业性能测试工具
GNU General Public License v3.0
633 stars 179 forks source link

Anyway to get device lock state? #91

Closed sanidhya-saraswat closed 1 year ago

sanidhya-saraswat commented 1 year ago

Event: com.apple.springboard.lockstate

Can I get it using rpc call or some other way ?

YueChen-C commented 1 year ago

I don't know how to get it directly. But you can get notification information through NotificationProxyService

sanidhya-saraswat commented 1 year ago

True, I was able to get notifications through the NotificationProxyService. But the notifications come, when the lock state changes. I want to know the current lock state.

I found this online: UIApplication.shared.isProtectedDataAvailable to get the lock state. Not sure how to call it.

khrithik96 commented 1 year ago

PyiOSDevice(device_id=<device_id>).rpc_channel.lockdown.get_value(key='PasswordProtected') This gives values as True when the device is locked and False when the device is unlocked.

YueChen-C commented 1 year ago

@khrithik96 That's great