Skip to content

Instantly share code, notes, and snippets.

@pavangandhi
Created January 26, 2018 04:15
Show Gist options
  • Save pavangandhi/324bac26b8db6407d554794b660dc564 to your computer and use it in GitHub Desktop.
Save pavangandhi/324bac26b8db6407d554794b660dc564 to your computer and use it in GitHub Desktop.
Fastlane integration
https://img.newsrush.com/thumbnail?width=500&url=encodeURL
FastLane Integration
-> Go Terminal and fire this command
xcode-select --install
-> Fire Command For Fasttlane Ruby Setup
fastlane init
IOS Snapsshot Generation Using Fastlane
->
1. Running your app through snapshot to automatically capture your screenshots
2. Having deliver send your final screenshots to iTunes Connect for use in the App Store
Add the following code to your fastlane/Fastfile:
Your screenshots will be stored in the ./screenshots/ folder by default (or ./fastlane/screenshots if you're using fastlane)
lane :screenshots do
capture_screenshots
upload_to_app_store
end
-> Automatically add device frames
fastlane frameit
To add the framing to your deployment process, use the following code in your Fastfile:
lane :screenshots do
capture_screenshots
frame_screenshots(white: true)
upload_to_app_store
end
IOS Beta Deployment
lane :beta do
build_app(scheme: "MyApp",
workspace: "Example.xcworkspace",
include_bitcode: true)
end
Try to call using “fastlane beta”
If everything works, you should have a [ProductName].ipa file in the current directory
The code sample below will use the latest build number from TestFlight and temporarily set it.
lane :beta do
increment_build_number(
build_number: latest_testflight_build_number + 1,
xcodeproj: "Example.xcodeproj"
)
sync_code_signing(type: "appstore") # see code signing guide for more information
build_app(scheme: "MyApp")
upload_to_testflight
crashlytics(api_token: "[insert_key_here]",
build_secret: "[insert_key_here]")
slack(message: "Successfully distributed a new beta build")
end
IOS AppStore Deployment
lane :release do
build_app(scheme: "MyApp",
workspace: "Example.xcworkspace",
include_bitcode: true)
end
Try running the lane using
fastlane release
For AppStore
lane :release do
increment_build_number(
build_number: latest_testflight_build_number + 1,
xcodeproj: "Example.xcodeproj"
)
capture_screenshots # generate new screenshots for the App Store
sync_code_signing(type: "appstore") # see code signing guide for more information
build_app(scheme: "MyApp")
upload_to_app_store # upload your app to iTunes Connect
crashlytics(api_token: "[insert_key_here]",
build_secret: "[insert_key_here]")
slack(message: "Successfully uploaded a new App Store build")
end
// increment version number
increment_version_number(
version_number: get_version_number(xcodeproj: "SolaroMobile.xcodeproj”)+1 // get present version number + 1
)
upload_to_testflight(skip_submission: true) # to only upload the build
Download existing screenshots from iTunes Connect
fastlane deliver download_screenshots
Download existing metadata from iTunes Connect
fastlane deliver download_metadata
=———————————————————————————————————=
# Minimum version of fastlane
fastlane_version “2.64.1”
default_platform :ios
platform :ios do
lane :screenshots do
capture_screenshots
frameit(white: true)
upload_to_app_store
end
desc "Deploy a new Beta version to the App Store"
lane :beta do
gym(scheme: "Solaro Mobile",
workspace: "SolaroMobile.xcworkspace",
include_bitcode: true)
increment_build_number(
build_number: latest_testflight_build_number + 1,
xcodeproj: "SolaroMobile.xcodeproj"
)
sync_code_signing(type: "appstore") # see code signing guide for more information
build_app(scheme: "Solaro Mobile")
# Variant 1: Provide a changelog to your build
#testflight(changelog: "Add Inital Build”)
upload_to_testflight(skip_submission: true)
crashlytics(api_token: "fbc6b9639c326e9c46e1697e22486dc4a7b63cd0",
build_secret: "0e80698e0a2bcaecd1e771608239d5352dd7823363052368931e7ac1fafcbb1d")
slack(message: "Successfully distributed a new beta build")
end
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new beta App Update."
# )
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
desc "Deploy a newAppStore version to the App Store"
lane :release do
increment_build_number(
build_number: latest_testflight_build_number + 1,
xcodeproj: "SolaroMobile.xcodeproj"
)
capture_screenshots # generate new screenshots for the App Store
sync_code_signing(type: "appstore") # see code signing guide for more information
build_app(scheme: "Solaro Mobile")
upload_to_app_store(skip_submission: true) # upload your app to iTunes Connect
crashlytics(api_token: "fbc6b9639c326e9c46e1697e22486dc4a7b63cd0",
build_secret: "0e80698e0a2bcaecd1e771608239d5352dd7823363052368931e7ac1fafcbb1d")
slack(message: "Successfully uploaded a new App Store build")
end
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new AppStore App Update."
# )
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
# 1
desc "Creating a code signing certificate and provisioning profile"
# 2
lane :provision do
# 3
produce(
app_name: 'AppName',
language: 'English',
app_version: '4.3.2',
sku: 'SOL-PT-112'
)
# 4
cert
# 5
sigh(force: true)
end
error do |lane, exception|
# This block is called, if there was an error running a specific lane.
end
end
upload_to_app_store(skip_submission: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment