简体   繁体   中英

Not able to Setup fastlane for iOS and android?

I'm using fastlane, Doing as https://docs.fastlane.tools/getting-started/ios/setup/ docs. But not able to setup properly.

Please guide me.

After spending enough time on R&D, i've found the proper way to install the fastlane.

Here i'm posting some command. just paste it on your terminal one by one

1: curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable —rails

2: GPG Install -> ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )”

3: brew install gnupg

4: RVM Install -> gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113XXXXXXXXXXX 7D2BAF1CF37B13E2069XXXXXXXXXXXXXX

5: source /Users/bedi/.rvm/scripts/rvm

6: curl -sSL https://get.rvm.io | bash -s stable --ruby

7: gem install fastlane

8: brew list openssl@1.1

9: ln -s /usr/local/Cellar/openssl@1.1/1.1.0f/bin/openssl /usr/local/bin/openssl

That's it now you have a fully pre-requites setup for fastlane. Now you can set it up according to your target OS.

1) https://docs.fastlane.tools/getting-started/ios/setup/

2) https://docs.fastlane.tools/getting-started/android/setup/

Fastlane is a collection of tools to automate building and releasing your iOS and Android apps. If you have before tried to deliver apps to TestFlight or the Apple Store, you know how long the process is: archiving the app, export it to the AppleStore, adding the new build (after an infinite processing time), adding screenshots for each device, jumping through a few more hoops and finallyyy, making it available to your tester or to the world.First of all we are going to install and setup fastlane. Assuming you are on a mac, open the terminal and run each of the following commands:

  1. sudo gem install fastlane --verbose then 2.xcode-select --install //this will pop up some actions from xCode then 3.gem cleanup

Once you have Fastlane installed, you can add different tools, depending on your needs. Here is list of fastlane commands from github:

Once you have your created your xcode project, go to its folder and run fastlane init . The script will prompt you for your apple ID/password, the app identifier, the scheme, create the app on iTunes Connect and the Apple Developer Port if necessary, and store all this information in fastlane/Appfile and fastlane/Deliverfile. Once everything is correctly set up, you should see something like that: Fastlane will then create a folder called fastlane with inside a Fastfile, which is the ruby configuration script. Here is an example file:

# Customise this file, documentation can be found here:

https://github.com/fastlane/fastlane/tree/master/fastlane/docs

All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

can also be listed using the fastlane actions command

Change the syntax highlighting to Ruby

All lines starting with a # are ignored when running fastlane

If you want to automatically update fastlane if a new version is available:

update_fastlane

This is the minimum version number required.

Update this, if you use features of a newer version

fastlane_version "1.89.0"

default_platform :ios

platform :ios do before_all do #test # to setup the proper urls, scroll down to part 3 ENV["SLACK_URL"] ||= " https://hooks.slack.com/services/xxxxxxx "

    # URL for Project #ios channel
    #ENV["SLACK_URL"] ||= "https://hooks.slack.com/services/xxxx"
    slack(message:"New version recieved, processing started")
end

after_all do |lane|
    # This block is called, only if the executed lane was successful

    # slack(
    #   message: "New App Update successfully deployed."
    # )
end

error do |lane, exception|
    slack(
        message: exception.message,
        success: false
    )
end

#lane to run unit tests
desc "[TEST] Runs all the tests"
lane :unittest do
    scan
end

#lane to send app to testflight
desc "[TESTFLIGHT] publish production"
    lane :tf_production do
    apple_testflight(scheme: "YOUR_SCHEME_NAME")
end

desc "[STORE] Deploy a new version"
lane :app_store do
    # match(type: "appstore")
    # snapshot
    build(scheme:"YOUR_SCHEME_NAME")
    deliver(force: true)
    # frameit
end

desc "[PRIVATE] Deploy a new version to the Testflight"
private_lane :apple_testflight do |options|

    scheme = options[:scheme]
    slack(message: "Starting processing "+scheme+" for Testflight")
    cert
    sigh
    #TODO: fix "increment_build_number" to bump ONLY the build number or the selected scheme 
    # increment_build_number
    build(scheme: scheme)
    resign(signing_identity:'#Name of the certificate as shown in the Keychain, for ex: iPhone Distribution: My COMPANY (XXXXXXXX)')
    pilot(

distribute_external: false,

testers_file_path:"./external_testers.csv"

    )
    slack(message: "Processing finished")
end

desc "[PRIVATE] Build usign schema"
private_lane :build do |options|
    scheme = options[:scheme]
    cocoapods
    gym(
        scheme: scheme,
        codesigning_identity: '#Name of the certificate as shown in the Keychain, for ex: iPhone Distribution: My COMPANY (XXXXXXXX)'
    )
end

end

More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md

All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

fastlane reports which actions are used

No personal data is recorded. Learn more at https://github.com/fastlane/enhancer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM