Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using KSScreenshotManager

Using KSScreenshotManager

Slides from my talk at Ottawa Cocoaheads on March 14, 2013.

Chuck Shnider

June 16, 2013

More Decks by Chuck Shnider

Other Decks in Programming


  1. KSScreenshotManager •Make your code generate the screenshots •Fully-Automated •Runnable from

    scripting environments •Sample Python Script included •Uses “WaxSim” to drive the iOS Simulator
  2. Like Test Automation •Not “For Free” •Cheaper to repeat over

    time •Effort scales more slowly than manual screenshots
  3. Modifying Your Code •WARNING Private API Usage! •Make sure none

    of this ships to the AppStore •Conditional Compile and perhaps use a new target
  4. setupScreenshotActions •Create instances of KSScreenshotAction •block-based API with optional cleanup

    blocks •synch or async, status bar or no [self addScreenshotAction:newAction];
  5. KSScreenshotAction block •Get the app to the correct state •Cheat

    as necessary •Fake Data, Mock Objects, etc. •Private APIs, both app and OS
  6. AppDelegate Changes #if CREATING_SCREENSHOTS dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 *

    NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ MyScreenshotManager *screenshotManager = [[MyScreenshotManager alloc] init]; [screenshotManager setTableViewController:viewController]; [screenshotManager takeScreenshots]; }); #endif