My app checks the certificate exists in the keychain periodically. (Use API 'SecItemCopyMatching')
Usually after my macbook wakes up, system will restart my app. Then my app cannot load the certificate. => SecItemCopyMatching always return errSecItemNotFound(-25300)
Until I restart it again by myself.
I remembered that the UEM Deploy my app had a similar situation before. My app launched after Deploy, SecItemCopyMatching always return errSecItemNotFound until I restart it myself.
There are 2 questions:
- Under what circumstances, Big Sur will restart a running App?
- Why App started by the system cannot find the Certificate in the Keychain?
Environment: BigSur @ M1 MacBook AIR
Build : XCode 12.2