Slide 1

Slide 1 text

Continuous Deployment to iOS yohei SUGIGAMI deliver • snapshot • frameit • PEM • sigh • produce

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

HOT!! Continuous Deployment to iOS

Slide 7

Slide 7 text

IUUQLJTIJLBXBLBUTVNJIBUFOBCMPHDPNFOUSZ Travis CIͰiOSΞϓϦͷϦϦʔε࡞ۀΛࣗಈԽ͢Δ

Slide 8

Slide 8 text

Mattt Thompson

Slide 9

Slide 9 text

Ship.io

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Build a workflow by the lane

Slide 12

Slide 12 text

˔εΫϦʔϯγϣοτΛ࡞Δ ˔ϕʔλ൛ͷϏϧυͱ഑෍Λߦ͏ ˔Ϗϧυͱ"QQ4UPSF΁ͷఏग़Λߦ͏
 ɹϓϩϏδϣχϯάϓϩϑΝΠϧͷߋ৽ ɹ৽͍͠εΫϦʔϯγϣοτͷ࡞੒ "QQ4UPSF΁ͷΞοϓϩʔυ
 ˔$*ͷதͰ࢖͏
 ɹ+FOLJOTɺ5SBWJT$*ɺ$JSDMF$* Use Case

Slide 13

Slide 13 text

˒̍,̑̌̌

Slide 14

Slide 14 text

Meet the fastlane family

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Lets’s install

Slide 18

Slide 18 text

Lets’s install Install Command Line Tools

Slide 19

Slide 19 text

Install $ sudo gem install fastlane
 
 Successfully installed fastlane-0.1.9 Successfully installed fastlane_core-0.1.1 Successfully installed deliver-0.7.10 Successfully installed snapshot-0.4.9 Successfully installed frameit-0.2.2 Successfully installed pem-0.3.4 Successfully installed sigh-0.3.3 Successfully installed produce-0.1.4 $ brew install xctool (for test)
 $ brew install imagemagick (for frameit)
 Options


Slide 20

Slide 20 text

$ cd [your_project_folder] $ fastlane init
 
 INFO This setup will help you get up and running in no time. INFO First, it will move the config files from `deliver` and `snapshot` INFO into the subfolder `fastlane`. INFO Fastlane will check what tools you're already using and set up INFO the tool automatically for you. Have fun! Do you want to get started? This will move your Deliverfile and Snapfile (if they exist) (y/n) y Do you have everything commited in version control? If not please do so! (y/n) y INFO Created new folder './fastlane'. INFO ------------------------------ INFO To not re-enter your username and app identifier every time you run one of the fastlane tools or fastlane, these will be stored from now on. App Identifier (com.krausefx.app): com.hoge.fuga Your Apple ID: [email protected] INFO Created new file './fastlane/Appfile'. Edit it to manage your preferred app metadata information. Do you want to setup 'deliver', which is used to upload app screenshots, app metadata and app updates to the App Store or Apple TestFlight? (y/n) y INFO Loading up 'deliver', this might take a few seconds Phantomjs does not appear to be installed in /Users/hoge/.phantomjs/1.9.8/darwin/bin/phantomjs, installing! Init

Slide 21

Slide 21 text

Successfully installed phantomjs. Yay! Removed temporarily downloaded files. Do you want Deliver to automatically create the Deliverfile for you based on your current app? The app has to be in the App Store to use this feature. (y/n) y First, you need to login with your iTunesConnect credentials. This is necessary to fetch the latest metadata from your app and use it to create a Deliverfile for you. If you have previously entered your credentials already, you will not be asked again. No username or password given. You can set environment variables: DELIVER_USER, DELIVER_PASSWORD ------------------------------------------------------------------------------------- The login information you enter will be stored in your Mac OS Keychain More information about that on GitHub: https://github.com/KrauseFx/CredentialsManager ------------------------------------------------------------------------------------- Password (for [email protected]): ********** INFO Could not find Apple ID based on the app identifier in the US App Store. Maybe the app is not yet in the store? INFO You can provide the Apple ID of your app using `apple_id '974739333'` in your `Deliverfile`
 
 Apple ID of your app (e.g. 284882215): 284882215
 
 INFO Going to download app metadata from iTunesConnect DEBUG [Transporter Output]: INFO: Transporter is searching for updated software components. Init

Slide 22

Slide 22 text

ERROR [Transporter Error Output]: Your Apple ID or password was entered incorrectly. (-20101) It seems like the username or password for the account '[email protected]' is wrong. Do you want to re-enter your username and password? (y/n) n DEBUG [Transporter Output]: DBG-X: The error code is: -20101 FATAL Transporter transfer failed. WARN ERROR Your Apple ID or password was entered incorrectly. (-20101) FATAL Return status of iTunes Transporter was 1: Your Apple ID or password was entered incorrectly. (-20101) ERROR Your Apple ID or password was entered incorrectly. (-20101) Return status of iTunes Transporter was 1: Your Apple ID or password was entered incorrectly. (-20101) FATAL Could not download metadata from iTunes Connect. Do you have special characters in your password (Like ' or ")? FATAL Error occured with the setup program! Reverting changes now! INFO Deleting the 'fastlane' folder /Users/hoge/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/deliver-0.7.10/lib/deliver/ app_metadata.rb:302:in `read': No such file or directory @ rb_sysopen - /tmp/968761649.itmsp// metadata.xml (Errno::ENOENT) (ɾ_ɾ;) Your Apple ID or password was entered incorrectly

Slide 23

Slide 23 text

IPVSTBHP ˏ@ˏ Alpha-numeric password works fine

Slide 24

Slide 24 text

INFO iTunes Transporter successfully finished its job DEBUG [Transporter Output]: DBG-X: Returning 0 INFO Successfully downloaded the latest package from iTunesConnect. INFO Modifying version '1.0.0' of app com.hoge.fuga Successfully created new metadata JSON file at './fastlane//deliver/metadata.json' Successfully created new Deliverfile at './fastlane//Deliverfile' Do you want to setup 'snapshot', which will help you to automatically take screenshots of your iOS app in all languages/devices? (y/n) y INFO Loading up 'snapshot', this might take a few seconds DEBUG Found 10 simulators. Successfully created SnapshotHelper.js './fastlane//SnapshotHelper.js' Successfully created new UI Automation JS file at './fastlane//snapshot.js' Successfully created new UI Automation JS file for iPad at './fastlane//snapshot-iPad.js' Successfully created new Snapfile at './fastlane/Snapfile' Do you want to use 'sigh', which will maintain and download the provisioning profile for your app? (y/n) y INFO 'deliver' enabled. INFO 'snapshot' enabled. INFO 'xctool' not enabled. INFO 'cocoapods' enabled. INFO 'sigh' enabled. INFO Created new file './fastlane/Fastfile'. Edit it to manage your own deployment lanes. INFO Successfully finished setting up fastlane Install

Slide 25

Slide 25 text

Fastfile

Slide 26

Slide 26 text

before_all do # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." # sh "./customShellScript.sh" team_id "Q2CBPK58CA"
 cocoapods increment_build_number xctool :test ipa({ workspace: "MyApp.xcworkspace", configuration: "Debug", scheme: "MyApp", }) end before_all

Slide 27

Slide 27 text

lane :beta do sigh increment_build_number ipa({ workspace: "RSSReader.xcworkspace", configuration: "Release", scheme: "RSSReader", clean: "" }) deliver :skip_deploy, :beta end lane

Slide 28

Slide 28 text

after_all do |lane| slack({ message: "Successfully deployed [App]", success: true, channel: 'development' }) end error do |lane, exception| # Something bad happened end after_all

Slide 29

Slide 29 text

lane :beta do snapshot sigh crashlytics({
 # path to your 'Crashlytics.framework' crashlytics_path: './Crashlytics.framework', api_token: '...', build_secret: '...', ipa_path: './app.ipa' }) end Crashlytics Beta

Slide 30

Slide 30 text

lane :beta do snapshot sigh
 deploygate({ api_token: '...', user: 'target username or organization name', ipa: './ipa_file.ipa', message: "Build", }) end DeployGate

Slide 31

Slide 31 text

Snapshot

Slide 32

Slide 32 text

Snapshot $ snapshot
 
 OR lane :snapshot do snapshot end 
 
 ./fastlane/Fastfile $ fastlane snapshot
 


Slide 33

Slide 33 text

Download zip to specify folder

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Config snapshot & frameit #import "SnapshotHelper.js" var target = UIATarget.localTarget(); var app = target.frontMostApp(); var window = app.mainWindow(); target.delay(3) captureLocalizedScreenshot("0-LandingScreen") ./fastlane/snapshot.js ./fastlane/Snapfile devices([ "iPhone 6", "iPhone 6 Plus", "iPhone 5", "iPhone 4s", "iPad Air" ]) languages([ "en-US", "de-DE", "es-ES" ]) Device, Language, Timing

Slide 36

Slide 36 text

AppleTestFlight

Slide 37

Slide 37 text

Initial setting for versioning

Slide 38

Slide 38 text

apple_id "9999999999" dir = File.expand_path(File.dirname(__FILE__)) + "/.." ipa do "#{dir}/RSSReader.ipa" end beta_ipa do "#{dir}/RSSReader.ipa" end ./fastlane/Deliverfile

Slide 39

Slide 39 text

Versioning by agvtool

Slide 40

Slide 40 text

INFO Driving the lane 'beta' INFO Step: team_id INFO Setting Team ID to 'xxxxxxxxxx' for all build steps INFO Step: sigh INFO Login into iOS Developer Center INFO Login successful INFO Fetching all available provisioning profiles... INFO Checking if profile is available. (72 profiles found) INFO Downloading profile... INFO Successfully downloaded provisioning profile INFO Exported provisioning profile to '/Users/susieyy/go/src/github.com/wantedly/swift-rss- sample/Distribution_com.susieyy.rss.mobileprovision' INFO open '/Users/susieyy/go/src/github.com/wantedly/swift-rss-sample/ Distribution_com.susieyy.rss.mobileprovision' INFO Step: increment_build_number INFO agvtool next-version -all INFO Step: ipa INFO ipa build -w "RSSReader.xcworkspace" -c "Release" -s "RSSReader" --clean INFO Step: deliver INFO Got all information needed to deploy a new update ('1.0.0') for app 'com.susieyy.rss' INFO Uploading ipa file to iTunesConnect INFO Going to upload updated app to iTunesConnect INFO iTunes Transporter successfully finished its job INFO Successfully uploaded package to iTunesConnect. It might take a few minutes until it's visible online. INFO fastlane.tools finished successfully ./fastlane/Deliverfile $ fastlane beta
 


Slide 41

Slide 41 text

iTunes Connect

Slide 42

Slide 42 text

Conclusion ˔/PNBEPJP TIFO[FO ʴ3BLF .BLFͳײ͡ ˔εΫϦʔϯγϣοτͷ࡞੒͸ศར ˔·ͩ·ͩൃల్্ͳͷͰࠓޙΛݟकΓ͍ͨ

Slide 43

Slide 43 text

ΤϯδχΞืूͯ͠·͢ɿʣ ͓͠·͍