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

Save countless hours of work with this one simple trick - Fastlane tools

Save countless hours of work with this one simple trick - Fastlane tools

Cocoaheads Montreal, 10/11/2015

Romain Pouclet

November 10, 2015
Tweet

More Decks by Romain Pouclet

Other Decks in Programming

Transcript

  1. Save countless hours
    of work with this one
    simple trick
    Cocoaheads Montréal -
    9/11/2015

    View Slide

  2. A couple of weeks
    ago, my girlfriend
    was out for the night
    so...

    View Slide

  3. ...I played with
    Fastlane while
    watching Netflix
    (Please don't judge me)

    View Slide

  4. Why?
    TL;DL: Because you could be doing something else

    View Slide

  5. Command line tools are usually...
    • Boring*
    • Hard to use (intuitively)
    • Hard to script (properly)
    • Hard to maintain (by the next one)
    Apple's are no exception
    (* Except Carthage, Carthage we like.)

    View Slide

  6. Let's build an app
    (litteraly)

    View Slide

  7. Building an app
    xcodebuild -project Rewatch.xcodeproj \
    -scheme Rewatch \
    -configuration QA \
    CONFIGURATION_BUILD_DIR="$CWD/build" clean build
    • 7 actions (clean, build, archive...)
    • 39 options
    • Terrible error reporting (usually
    "error 65")

    View Slide

  8. Packaging the app
    into an IPA
    xcrun -sdk iphoneos \
    PackageApplication "$CWD/build/Rewatch.app" \
    -o "$CWD/build/Rewatch.ipa"
    • Huge perl script
    • (Don't laught, perl 6 was released
    last month)

    View Slide

  9. Pushing the app on
    the App Store from
    the command line
    • ¯\(ϑ)/¯
    • Unofficial API
    • Reverse engineered by looking at
    Application Loader ?

    View Slide

  10. Writing a script to wrap all this
    • Usually end-up copy/pasted accross multiple projects...
    • ...or shared as a submodules or something similar
    • Suggested a relatively simple one in my book, around
    100LOC (#humblebrag)

    View Slide

  11. You're not done yet!
    • Code Signing certificates
    • Provisioning profiles
    • Screenshots
    • Push Certificates
    • ...

    View Slide

  12. Introducing Fastlane

    View Slide

  13. Introducing
    Fastlane
    • Automatize all the things you need
    and then some
    • Define and run your deployment
    pipelines for different environments
    (debug, qa, production...)
    • Written in Ruby (by the guy on the
    left, Felix Krause)
    • Each part can be use as standalone
    tools
    • iOSDevWeekly frequent flyer

    View Slide

  14. Let's build an app
    (litteraly)

    View Slide

  15. Building the app
    with Fastlane
    gym
    (seriously)

    View Slide

  16. Gym will...
    • Automatically detect your
    workspace and pick the scheme (or
    ask you for the one to use)
    • Wrap the output in xcpretty

    View Slide

  17. But wait, there is more
    • Deliver will upload your app and metadata to the app store
    • Snapshot will take screenshots
    • FrameIt will resize screenshots into right devie frames
    • Pem will manage your push notification profiles
    • Cert & Sigh will magically fix your code signing issues
    • Produce will create th app on iTunes Connect
    • Scan will run tests

    View Slide

  18. Wrapping the Fastlane tools using
    Fastlane
    gem install fastlane
    fastlane init
    (Even better is adding Fastlane as a dependency in your
    Gemfile)
    source "https://rubygems.org"
    gem 'fastlane', '~> 1.36', '>= 1.36.4'%

    View Slide

  19. Fastfile
    platform :ios do
    before_all do
    carthage(platform: "iOS")
    end
    desc "Submit a new Beta Build to Apple TestFlight"
    lane :beta do
    # ...
    end
    end

    View Slide

  20. Fastfile
    desc "Submit a new Beta Build to Apple TestFlight"
    lane :beta do
    sigh
    gym(scheme: "Rewatch", use_legacy_build_api: true)
    pilot
    end

    View Slide

  21. Using a lane
    fastlane beta

    View Slide

  22. Mirego

    View Slide

  23. Mirego
    • We just released a group of app
    • 6 apps x 5 screenshots x 5 devices =
    150 screenshots took manually

    View Slide

  24. Mirego
    • Uses a 1300 LOC bash script that does a lot
    • It also handles a lot of cases so big up to our CTO for writing
    and maintaining that

    View Slide

  25. We are definitely
    looking into Fastlane
    (and hiring)

    View Slide

  26. Rewatch

    View Slide

  27. Rewatch ! Fastlane
    • iOS application that suggests
    episode to, well, rewatch
    • Hoping to release a beta soon-ish,
    register on rewatchapp.com
    • rewatchapp.com is using
    "Boarding"
    • rewatchapp.com was online in one
    hour (design included)

    View Slide

  28. Bonus
    • Fastlane has a great community
    • This is a true story
    • Posted a tweet the night I was
    playing with Fastlane
    • I hid my phone under a pillow
    because of the 40+ notifications I
    got in the following hour

    View Slide

  29. Thank you!
    Questions?
    • Twitter: @palleas
    • romain-pouclet.com
    • http://fastlane.tools

    View Slide