Skip to content

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

License

Notifications You must be signed in to change notification settings

amedvedjev/instruments-without-delay

 
 

Repository files navigation

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

The simulator identifier/name can optionally be added as an argument:

./build.sh test D82D8D7B-5253-3300-B083-B6F739F68355

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 83.4%
  • C 7.2%
  • Shell 5.8%
  • JavaScript 3.6%