Search code examples
iosios5instrumentsui-automationios-ui-automation

Having Instruments always revert to script file on disk (instead of prompting) for iOS UIAutomation testing


Question: Is there some way to shush up Instruments from warning about changes on disk to the currently loaded script, and have it just use the latest version of the script on disk? I'm always editing it outside of Instruments.

Background: I'm editing my UIAutomation scripts (JavaScript of course) inside Xcode. I select them in the UIAutomation Instrument for profiling with the Instruments tool. I can hit record and all is good.

As I'm building my testing script, I'll edit it in Xcode and toggle the record button in the Instruments app to restart the test.

Instruments prompts me about a change to the script in an external location. I say "Revert" (to disk version) every time. I'm not keen on editing my scripts inside Instruments because then I keep switching between the 'Script' view and the 'Trace Log' view.

  • Note: I'm using Xcode 4.4.1 on Mountain Lion 10.8.1 with the iOS5.1 base SDK.

Solution

  • I found a solution:

    • I use an #import directive in a javascript file to import the file that I'm constantly changing.
    • I point Instruments to this shell of a javascript file, whose only purpose is to import my actual test file, in active development.
    • I then modify the file I'm actively developing, in another editor, and Instruments won't complain