amyworrall / instruments-without-delay

Changes Apple's Instruments tool to remove the 1 second delay in UIAHost.performTaskWithPathArgumentsTimeout

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

instruments-without-delay

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.

NOTE: For pre-Xcode 6, build from e4e474c7e9559bfc34724b3338c56b28b3390cd2 as Xcode 6 support introduced breaking changes.

Usage

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.

How it works

Instruments launches UIAutomation scripts in the iOS Simulator with a program called ScriptAgent. Actually, Instruments launches the iOS Simulator, which starts up the whole Simulator environment. Eventually, DTMobileIS is started up which finally starts 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.

About

Changes Apple's Instruments tool to remove the 1 second delay in UIAHost.performTaskWithPathArgumentsTimeout

License:Other


Languages

Language:Objective-C 84.3%Language:C 7.0%Language:Shell 5.2%Language:JavaScript 3.5%