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.