使用 fastlane 自动化部署iOS APP

安装 fastlane

这里使用Rubygems 方式安装fastlane。(MacOS or Linux with ruby 2.0.0 or above)

sudo gem install fastlane

设置fastlane

用Terminal进入你的项目目录,然后执行

fastlane init

然后会询问你的Apple ID,根据提供的信息,生成fastlane的配置文件

使用fastlane测试部署

构建你的应用

编辑fastfile:

lane :beta do
    gym(scheme: "MyApp",
        workspace: "MyApp.xcworkspace",
        include_bitcode: true)
end

测试运行我们定制的 lane(任务):

fastlane beta

如果顺利执行的话,你将会在当前文件目录看到一个 MyApp.ipa 文件和对应 MyApp.app.dSYM 文件

上传应用

lane :beta do

    match(type: "appstore")                 # see code signing guide for more information
    gym(scheme: "MyApp",
        workspace: "MyApp.xcworkspace",
        include_bitcode: true)              # build your app
    testflight                              # upload your app to TestFlight
    
end

或者再配置下上传至TestFlight的过程:

lane :beta do

    match(type: "appstore")             
    gym(scheme: "MyApp",
        workspace: "MyApp.xcworkspace",
        include_bitcode: true) 
                     
    # Variant 1: Provide a changelog to your build
    testflight(changelog: "Add rocket emoji")

    # Variant 2: Skip the "Waiting for processing" of the binary
    # While this will speed up your build, it will not distribute
    # the binary to your tests, nor set a changelog
    testflight(skip_waiting_for_build_processing: true)
    
end

使用fastlane部署至Apple Store

编辑Fastfile:

lane :appstore do
    
    snapshot
    #gym(scheme: "MyApp")
    gym(scheme: "MyApp",
        workspace: "MyApp.xcworkspace",
        include_bitcode: true)
    appstore

end

执行:

fastlane appstore
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容