Tech Talk #5 : ApplyCI tools in iOSdevelopment - Trương Minh Khôi

  • View
    250

  • Download
    3

  • Category

    Mobile

Preview:

Citation preview

ApplyCItoolsiniOSdevelopment

KhoiM.TruongInnovatube

Strategies

Fastlane

• Automatetasks• Pipeline

lane :beta doincrement_build_numbercocoapodsmatchtestflight sh "./customScript.sh”slack

end

Whyfastlane?

• Oneworkflow

Whyfastlane?

• Differentlanesforeachstrategies

lane :test doscan

end

lane :beta doscanpemmatchgympilotslack

end

Whyfastlane?

• Deployfromanywhere(local,CIserver,...)• Customizable,easytoextend• StoreeverythinginGit• Over170built-inintegrationsavailable• Gooddocumentations• …

Fastlanetoolchain

• deliver• snapshot• pem• sigh• cert• spaceship• pilot• boarding• gym• match• scan

Demo

Install

sudo gem install fastlane -verbose

xcode-select -install

gem cleanup

Init

fastlane init

Commands

fastlane beta

fastlane appstore

fastlane test

Actions

scan

increment_build_number

pem

match

gym

Actions

Additional actionshttps://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

Fastfile

Fastfile

• Ruby

fastlane_version "1.98.0”default_platform :ios

Fastfile

platform :ios do# Do something

end

Fastfile

before_all doENV["DEVELOPER_DIR"] = "/Applications/Xcode.app"

end

Fastfile

lane :beta doscan(scheme: "Beta",device: "iPhone 6s”

)end

Fastfile

lane :test doscan

end

lane :beta doscan( # Command namescheme: "Beta", # Parameterdevice: "iPhone 6s”

)end

Appfile

app_identifier "com.khoitm.AlaskaRiver"apple_id "developer@mail.com"team_id "ABCD1234”

identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)

Staticanalysis

brew install swiftlint

# Configurations.swiftlint.yml

Staticanalysis

swiftlint(mode: :lint,output_file: 'swiftlint.result.json', config_file: '.swiftlint.yml', ignore_exit_status: true

)

• Unittesting• Testreport• Slacknotification• Scanfile

• Unittesting• Runtestsonmulti-device• Testreport• Slacknotification• Scanfile

• Pushnotificationprofiles• Generate• Maintain

1. CreateGitrepotostoreprofiles(certificates,provisions,…)2. Createprivatekeysandcertificatesfor“Distribution”and

“Development”.3. Createprovisioningprofilesfortargets

• Development• AppStore• Adhoc

4. EncryptcertificatesandprovisioningprofileswithOpenSSL5. AccessGitrepofromeachmachinetogetcertificatesand

profiles6. ConfigXcodewithprofiles7. UpdateprofileswhenadddeviceinDevPortal

match(type: "adhoc",app_identifier: app_identifier,git_url: https://some.git/repo/certificates

)

• BuildiOS/macOSapps• 30%fasterthanshenzhen• Auto-genipaanddSYM• Gymfile• ArchiveaccessiblefromXcodeOrganizer

gym(scheme: "Beta")

• Environmentvariables

ENV["DEVELOPER_DIR"] = "/Applications/Xcode7.app"

Betadistribution

crashlytics(crashlytics_path: './Pods/Crashlytics/', api_token: 12345678abc',build_secret: ’987654321edf',ipa_path: './AlaskaRiver.ipa',emails: ’tester@mail.com’

)

To-Dos

• IntergratewithJenkin orXcodeserver• UploadscreenshotsandAppinfotoiTunesConnectusingdeliver andsnapshot• Notifybetatestersandotherdevelopersusingslack• AutomateUItesting• Automatebuildingwithmulti-target:• Development• Alpha• Beta• Production

Othertools

• deliver:Uploadscreenshots,metadata,andyourapptotheAppStore• snapshot:AutomatetakinglocalizedscreenshotsofyouriOSapponeverydevice• pilot:ThebestwaytomanageyourTestFlighttestersandbuildsfromyourterminal• boarding:TheeasiestwaytoinviteyourTestFlightbetatesters• spaceship:RubylibrarytoaccesstheAppleDevCenterandiTunesConnect

Othertools

• circleci.com• buddybuild.com• travis-ci.org• greenhouseci.com• Jenkin

Comparations:http://www.mjdinteractive.com/picking-a-continuous-integration-platform-for-mobile-projects/

Buddybuild

Buddybuild

Free100%!

Reference

• https://fastlane.tools/• https://github.com/fastlane• https://codesigning.guide/• https://www.raywenderlich.com/116065/fastlane-tutorial-getting-started

Thanksforlistening!

Recommended