Access personal data from Xcode tests

macOS does not simply allow any app to access user’s personal data. This includes Xcode. An attempt to access Address Book or Reminders from a test will fail. Unfortunately you cannot simply add the app to System Preferences’ Privacy settings.

However, there is a workaround: simply create a Playground and request the all necessary permissions. The way Xcode runs them will pop all the necessary system dialog and will you to grant the access.

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store