Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Build and Deliver iOS (Fastlane)

patogallaiovlabs edited this page Apr 14, 2021 · 2 revisions

Install Fastlane

Setup fastlane environment variable

  • Add a file in ./fastlane folder called .env, you can use template file: .fastlane/.env.ios
  • Note : Read carefully the comments on the file, on how to fill the values.

Install Xcode

  1. Make sure you have the latest version of the Xcode command line tools installed:

    • xcode-select --install

Enable Keychain App

  • Go to 'System Preference -> Internet Accounts -> iCloud (sidebar)'
    • Look for Keychain and press checkbox.

Create Certificate Request

  • Go to 'Launchpach', open 'Keychain app'.
    • Go to 'Keychain Access' menu
    • Then 'Certificate Assistance'
    • And “Request a Certificate from a Certificate Authority”
  • Fullfil with email and a name that could identify this cert.
  • For “CA Email Address” leave it blank.
  • And select “Saved to disk”
  • Final file would be something like : CertificateSigningRequest.certSigningRequest

Create Certificate

  • Go to: Apple Certificate Manager
  • Click on “+”
  • Select “iOS Distribution (App Store and Ad Hoc)” and “continue”
  • Upload *.certSigningRequest file generated in previous step and “continue”
  • Click “Download” and save the .cert file.

Create GitHub repo

  • Create a private repo on GitHub and upload the .cert to it

Configure Fastlane Env

  • Create file ‘.env’ inside “fastlane” folder
  • Check “Fastlane Env File”

Upload Certs to Apple

  • fastlane match appstore --verbose
    • In case you want to redo the process:
    • fastlane match nuke distribution (for cleaning keychain keys)

Generate TestFlight release

  • fastlane ios beta version:<version> build:<build> --verbose
    • <version> : with the form of x.y.z, i.e.: 1.3.4
    • <build> : integer, remove the param for an automatic increment, i.e.: 40

Troubleshooting

  1. The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020. Remove Libraries/React.xcodeproj/React/Views/RCTWebView.h、RCTWebView.m、RCTWebViewManager.h、RCTWebViewManager.m in Xcode to remove UIWebView.