Is there a way to remove the authorization prompt from command-line instances of Instruments (Xcode)?

前端 未结 11 969
南笙
南笙 2020-12-02 07:53

I am currently using Instruments via a bash script to initiate the command-line interface to start up runs of the Automation plug-in.

With 4.2, this worked well en

相关标签:
11条回答
  • 2020-12-02 08:41

    I partially solved this issue. I run instruments from command line and have authorization prompt in GUI (once per session) + this in console (each time I run instruments):

    Instruments: Instruments wants permission to analyze other processes.
    Type your password to allow this.
    Name ([my-username]):
    Password:
    
    Failed to authorize rights (0x20) with status: -60007.
    2012-02-28 10:04:19.607 instruments[60398:1203] Failed to connect to
    local pid watcher service: (os/kern) failure
    

    I compared /etc/authorization file before and after upgrading to xCode 4.3. Apple replaced two keys:

    <key>com.apple.dt.instruments.process.analysis</key>
    <key>com.apple.dt.instruments.process.kill</key>
    

    with

    <key>com.apple.instruments.process.analysis</key>
    

    I edited /etc/authorization, added missing keys below new one and issue from console is solved. Unfortunately GUI prompt is still there.

    Mising keys:

    <key>com.apple.dt.instruments.process.analysis</key>
    <dict>
        <key>allow-root</key>
        <true/>
        <key>class</key>
        <string>user</string>
        <key>comment</key>
        <string>Rights for Instruments</string>
        <key>group</key>
        <string>admin</string>
        <key>shared</key>
        <true/>
        <key>timeout</key>
        <integer>36000</integer>
        </dict>
    <key>com.apple.dt.instruments.process.kill</key>
    <dict>
        <key>allow-root</key>
        <true/>
        <key>class</key>
        <string>user</string>
        <key>comment</key>
        <string>Rights for Instruments</string>
        <key>group</key>
        <string>admin</string>
        <key>shared</key>
        <true/>
        <key>timeout</key>
        <integer>5</integer>
    </dict>
    

    Hope this will point you to solve whole issue

    0 讨论(0)
  • 2020-12-02 08:48

    I also tried security unlock-keychain and changed the /etc/authorization file, and have DevToolsSecurity enabled, but none of them worked, until I launched the Instruments GUI app and run my script, from which it popped up a dialog and i entered my password, after then when i run the instruments script again it doesn't require password anymore!

    0 讨论(0)
  • 2020-12-02 08:51

    This is the solution worked for me :

    <key>system.privilege.taskport</key>
    <dict>
    <key>allow-root</key>
    <false/> 
    <key>class</key>
    <string>user</string> // change to -> allow
    <key>comment</key>
    <string>Used by task_for_pid(...).
    ...
    </dict>
    
    0 讨论(0)
  • 2020-12-02 08:52

    Okay I think I got it working.

    Here are some more details about how to remove xcode command line authorization prompt

    What I did was the following:

    • Mark jenkins user as admin (unfortunately it seems that there is no other way atm)
    • Go to /etc/authorization
    • search for key system.privilige.taskport
    • change value of allow-root to true

      <key>system.privilege.taskport</key>
      <dict>
          <key>allow-root</key>
          <false/> // change to -> <true>
          <key>class</key>
          <string>user</string>
          <key>comment</key>
          <string>Used by task_for_pid(...).
          ...
      </dict>
      

    Now I am being able to use jenkins to run my UIAutomation-Tests via Command Line Script

    0 讨论(0)
  • 2020-12-02 08:53

    In Xcode - if you load up organizer (Xcode->Window->Organizer)

    Then select your machine under devices -> 'Enable Developer Mode'

    This should remove the need for prompts with instruments.

    0 讨论(0)
提交回复
热议问题