Search code examples
ioscommand-lineinstrumentsios-ui-automation

Running Apple Instruments from command line throws: The simulated application quit


enter image description here

This popup prevent other scripts from running and prints the following:

instruments[2596] : kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection instruments[2596] : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.

Segmentation fault: 11

I use subprocess (in python) to run number of scripts for testing my app.

Is it a bug in instruments? cause sometimes it just print to log a debug event: "The target application appears to have died", which doesn't stop scripts flow.

Any ideas?

[Edit]

I've updated yesterday command line tools and it seems to provide more details now:

[__NSCFType transport]: unrecognized selector sent to instance 0x7fa54ba61b50 

09:43:49.987 instruments[2544:1203]_stopScript: threw -[__NSCFType transport]: unrecognized selector sent to instance 0x7fa54ba61b50 

2012-06-15 09:43:49.988 instruments[2544:1203] * -[NSConditionLock dealloc]: lock (NSConditionLock: 0x7fa548dbd480> '(null)') deallocated while still in use 

2012-06-15 09:43:49.988 instruments[2544:1203] * Break on _NSLockError() to debug.

Solution

  • You need to use the .app file in the iPhone simulator directory.

    (or)

    Do an xcodebuild with DSTROOT flag to deposit the app and use that for the automation.

    xcodebuild -workspace ./ProjectWorkspace.xcworkspace -scheme "SchemeName" -sdk 
    iphonesimulator5.1 -configuration "Debug" clean build install 
    DSTROOT=~/Desktop/tmp/yourAppName.app