重置设备上的钥匙串 [英] Reset keychain on the device
问题描述
我在设备上的应用内测试登录流程(使用 KeychainItemWrapper
)。如何重置/删除我的应用程序的钥匙串?
I'm testing login flow (using KeychainItemWrapper
) inside my app on a device. How do I reset/delete keychain for my app?
在模拟器上,我点击 iOS模拟器 - > 重置内容和设置... 。
On the Simulator, I do it by clicking on iOS Simulator -> Reset Content and Settings....
推荐答案
钥匙串项目在iOS沙箱中,用户无法访问删除不需要的钥匙串项目。这些只能通过API访问。
Keychain items are in iOS sandbox, users don't have access to remove unwanted keychain item. These are accessible via API's only.
KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:[[NSBundle mainBundle] bundleIdentifier] accessGroup:nil];
//或如何访问钥匙串
//or how you access your keychain
[keychainItem resetKeychainItem];
或者您可以从设备设置,常规,重置,重置所有设置重置设备>>。
但是,它会重置设备上安装的每个应用程序的钥匙串。
or you can reset your device >> from the device Settings, General, Reset, Reset All Settings. But, it will reset the keychain for every app installed on the device.
这篇关于重置设备上的钥匙串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!