UIAutomation Tests Fail after Authorization Dialog

Originator:heath.borders
Number:rdar://10945962 Date Originated:28-Feb-2012 11:19 AM
Status:Open Resolved:
Product:iPad SDK Product Version:Version 4.3 (4E109)
Classification:Serious Bug Reproducible:Sometimes
 
Summary:
I have many UIAutomation javascript tests for my iPad app.  After upgrading to Xcode 4.3 on Lion 10.7.3, I see a dialog with the following dialog the first time I run my tests in the Instruments GUI after restarting my box:

Developer Tools Access is trying to take control of another process. Type your password to allow this.

Even if I enter my correct credentials, the test often fails with the following error:

Fail: Could not start script, target application is not frontmost.

When I run my instruments test from the command line, I get the same dialog, and often the same result.  

I also have a script that runs many instruments tests successively.  When I run instruments from this script, I get the following prompt in my terminal:

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
2012-02-28 16:04:20 +0000 Fail: An error occurred while trying to run the script.
2012-02-28 16:04:20 +0000 Fail: The target application appears to have died

I always get the above output, even when I correctly enter my password.

Occasionally, instruments successfully runs my test, but I can't reproduce that reliably.  Much more often, I get one of the above dialogs or prompts, and then my tests fail.

My user is a member of the developer group, and has administrator privileges.

Steps to Reproduce:
From UI:
Restart system
Profile iPad Application
Choose UIAutomation Instrument
(Authorization Dialog Sometimes appears here)
Add a test script
(Authorization Dialog Sometimes appears here)

From command line:
Run the following command
instruments -t /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/MyUser/Library/Developer/Xcode/DerivedData/MyiPadProject-btrlvecdbhutdsafmouplbiwlrra/Build/Products/MyiPadTarget-iphonesimulator/MyiPadProject.app -e UIASCRIPT MyTest.js

Expected Results:
No authorization dialog appears, test runs

Actual Results:
Authorization dialog sometimes appears, test fails with:
"Fail: Could not start script, target application is not frontmost."

Regression:

Notes:

Duplicates

Number Status Originator Product Title
rdar://14135016 Duplicate/10945962 jeff instruments instruments command-line tool requests authorization on launch

Comments

Duped as 14135016

This is broken as of Xcode 4.6.2, though the dialog only appears when I run the instruments command-line tool, never when using the GUI.

Appears fixed

This appears to work with Xcode 4.3.2

By heath.borders at May 2, 2012, 3:06 p.m. (reply...)

Duplicated as 10972598

By joseph.hainline at March 2, 2012, 6:37 p.m. (reply...)

Duped as 10956414

Duped as 10956381


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!