instruments-without-delay fixes the 1-second delay problem when using UIAHost.performTaskWithPathArgumentsTimeout
inside of Apple's Instruments / UIAutomation tool. performTaskWithPathArgumentsTimeout
would normally take 1 second to respond regardless of how fast the task finishes.
If you're using Instruments to drive UI integration tests (e.g. with ios-driver), this hack can significantly speed up testing.
Build and run the test:
./build.sh test
Under the build
directory, you'll have a new instruments
script. Use it in place of /usr/bin/instruments
.
Instruments launches UIAutomation scripts in the iOS Simulator with a program called ScriptAgent. Actually, Instruments launches a small helper program called sim, which in turn launches ScriptAgent. ScriptAgent is what actually links UIAutomation.framework and runs the scripts, so we inject a library into ScriptAgent that swizzles out performTaskWithPathArgumentsTimeout
with our own implementation that has no 1 second delay.