Test Target for debugging as root process

I added a new test target in xcode. I want to test my unit test cases by running it as root, as this involves creating specific directories in which root has permissions. But I found that it is disabled to select the process to run with root privileges. Any help on how to test it with root privileges? enter image description here

+4
source share
1 answer

I had this problem and managed to fix it by manually editing the corresponding * .xcscheme file.

Assuming you have configured the Run configuration for this, you will see the following in the file *.xcscheme:

  <LaunchAction
  ...
  debugAsWhichUser = "root"
  ...>
      ...
  </LaunchAction>

TestAction:

  <TestAction
  ...
  debugAsWhichUser = "root"
  ...>
      ...
  </TestAction>

XCode, , :

, ! * , 8.1 (8B62), , , YMMV.

+2

Source: https://habr.com/ru/post/1623900/


All Articles