Hi!
I am trying to make a UI Testing target in Xcode for my Application (Client). It works with Keychain items that are created during installation, so in order to mock this installation behavior I am creating the items like this:
security add-generic-password -U -D "[item_kind]" -a "[account]" -l "[label]" -s [service] -w "[value]" -T path/to/UITest-runner.app -T path/to/Client-app.app
However, during UI Testing, the application is still prompted to access or modify the Keychain Items as seen in the bottom half of this screenshot:
These application paths have been obtained by the find
terminal command inside DerivedData/.../Build/Products/... so they are the correct paths (which is also proven I guess by the fact that the apps are correctly listed in the ACL window of Keychain Access as seen on the top half of the screenshot).
I also tried using the -A
option instead of -T
but the result is exactly the same.
Why doesn't this approach work during UI Testing? I am using the same approach in my installation script for the real application installation process with the -T
parameters and there is no issue in that case. This issue kills my UI Tests because I am constantly prompted when I want to read of modify the contents of these Keychain Items.