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

Automating Screenshots with Fastlane by Dan Leehr

Automating Screenshots with Fastlane by Dan Leehr

Lightning Talk from March 2015 CocoaHeads Raleigh/Durham

More Decks by Triangle Cocoa - Lightning Talks

Other Decks in Programming

Transcript

  1. Ugh • Building an app • Distributing to testers •

    App Descriptions and Screenshots • Profiles and Certificates • Running Tests
  2. snapshot 1. $ gem install snapshot 2. $ snapshot init

    3. Record UI Test 4. Add snapshot() calls 5. $ snapshot
  3. Screenshots.swift func generateiPadScreenshots() { XCUIDevice.sharedDevice().orientation = .LandscapeLeft let app =

    XCUIApplication() let tablesQuery = app.tables tablesQuery.staticTexts["UICKeychainStore"].tap() let uickeychainstoreNavigationBar = app.navigationBars["UICKeychainStore"] uickeychainstoreNavigationBar.buttons["728 clock toolbar"].tap() tablesQuery.staticTexts["Stop using CircleCI"].tap() snapshot("01-branch-graph") Auto-generated by recording a UI Test
  4. Snapfile # A list of devices you want to take

    the screenshots from devices([ "iPhone 6", "iPhone 6 Plus", "iPhone 5", "iPhone 4s", "iPad Retina", "iPad Pro" ]) languages([ "en-US", ])
  5. +---------------+---------+ | snapshot results | +---------------+---------+ | Device | en-US

    | +---------------+---------+ | iPhone 6 | | | iPhone 6 Plus | | | iPhone 5 | | | iPhone 4s | | | iPad Retina | | | iPad Pro | ❌ | +---------------+---------+
  6. frameit 1. $ gem install frameit 2. $ frameit (place

    PSDs) 3. Write Framefile.json 4. $ frameit
  7. keyword.strings "branch-graph" = "Visualize"; "text-editor" = "Git-enhanced"; "commit-view" = "Your

    git workflow"; "repo-list" = "Powerful"; "add-repo" = "Integrate";
  8. title.strings "branch-graph" = "branches and commits intelligently"; "text-editor" = "text

    editor for 30+ languages"; "commit-view" = "anywhere you go"; "repo-list" = "Document Provider & Multitasking"; "add-repo" = "with GitHub and Bitbucket";
  9. $ frameit [13:26:29]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadPro-01-branch-graph_framed.png' [13:26:43]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadPro-02-text-editor_framed.png'

    [13:26:56]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadPro-03-commit-view_framed.png' [13:27:09]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadPro-04-repo-list_framed.png' [13:27:22]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadPro-05-add-repo_framed.png' [13:27:29]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadRetina-01-branch-graph_framed.png' [13:27:37]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadRetina-02-text-editor_framed.png' [13:27:44]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadRetina-03-commit-view_framed.png' [13:27:52]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadRetina-04-repo-list_framed.png' [13:27:59]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPadRetina-05-add-repo_framed.png' [13:27:59]: Unfortunately 3.5" device frames were discontinued. Skipping screen './en-US/iPhone4s-01-branch-graph.png' [13:27:59]: Looked for: 'iPhone_4_Vert_SpaceGray.png' [13:28:01]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone4s-01-branch-graph_framed.png' [13:28:01]: Unfortunately 3.5" device frames were discontinued. Skipping screen './en-US/iPhone4s-02-text-editor.png' [13:28:01]: Looked for: 'iPhone_4_Vert_SpaceGray.png' [13:28:02]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone4s-02-text-editor_framed.png' [13:28:02]: Unfortunately 3.5" device frames were discontinued. Skipping screen './en-US/iPhone4s-03-commit-view.png' [13:28:02]: Looked for: 'iPhone_4_Vert_SpaceGray.png' [13:28:04]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone4s-03-commit-view_framed.png' [13:28:04]: Unfortunately 3.5" device frames were discontinued. Skipping screen './en-US/iPhone4s-04-repo-list.png' [13:28:04]: Looked for: 'iPhone_4_Vert_SpaceGray.png' [13:28:06]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone4s-04-repo-list_framed.png' [13:28:06]: Unfortunately 3.5" device frames were discontinued. Skipping screen './en-US/iPhone4s-05-add-repo.png' [13:28:06]: Looked for: 'iPhone_4_Vert_SpaceGray.png' [13:28:07]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone4s-05-add-repo_framed.png' [13:28:10]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone5-01-branch-graph_framed.png' [13:28:12]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone5-02-text-editor_framed.png' [13:28:14]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone5-03-commit-view_framed.png' [13:28:17]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone5-04-repo-list_framed.png' [13:28:19]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone5-05-add-repo_framed.png' [13:28:22]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone6-01-branch-graph_framed.png' [13:28:25]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone6-02-text-editor_framed.png' [13:28:28]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone6-03-commit-view_framed.png' [13:28:31]: Added frame: '/Users/dcl9/Code/iOS/clone/fastlane/screenshots/en-US/iPhone6-04-repo-list_framed.png'
  10. Grab Bag • SimulatorStatusMagic: 9:41 AM with 100% battery forever


    
 https://github.com/shinydevelopment/SimulatorStatusMagic
 • frameit silver: Silver/White device frames
 • deliver: Upload screenshots to iTunes Connect from CLI