ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

从零开始devops-fastlane配置

2021-04-06 16:36:32  阅读:477  来源: 互联网

标签:version xxx fastlane devops value number 从零开始 path plist


https://www.jianshu.com/p/db5fe7fed9f3
https://blog.csdn.net/l7022995/article/details/79321924
https://www.jianshu.com/p/840943eff17b
打包脚本

# You can define as many lanes as you want
desc "Deploy a new version to the App Store"
lane :release do |op|
increment_version_number(version_number: op[:version]) #根据入参version获取app版本号
increment_build_number(build_number: op[:version]) #将build号设置与app版本号相同


    # 设置app的info.plist文件项
    set_info_plist_value(path: "./xxx/Info.plist",  #info.plist文件目录
                        key: "UIFileSharingEnabled",  # key,将plist文件以Source Code形式打开可查询对应的key
                        value: false)  # value

    # 设置自定义plist文件项,用于给app配置不同的服务器URL
    set_info_plist_value(path: "./xxx/hostAddress.plist",
                        key: "host",
                        value: "https:/zhengshiServer:xx/xxx/xxx")

    # 设置某些服务是否有效
    # 还可以使用modify_services,具体参考官网相关文档
    produce(
        enable_services:{
            push_notification: "on",
       }
    )

    # 更新Provisioning Profile
    # 在项目当前目录下创建provisions文件夹,并将App Store版本的.mobileprovision文件保存在里面,名称随意。
    update_project_provisioning(profile: "./provisions/appstore.mobileprovision")

    # 更新项目团队
    update_project_team(path: "xxx.xcodeproj",
                  teamid: "5JC8GZ432G")

    # 开始打包
    gym(# use_legacy_build_api: true,  # Xcode 9之后,需要去掉
        output_name: "appstore",  # 输出的ipa名称
        silent: true,  # 隐藏没有必要的信息
        clean: true,  # 在构建前先clean
        configuration: "Release",  # 配置为Release版本
        codesigning_identity: "iPhone Distribution: xxx Co.,Ltd. (5JC8GZ432G)",  # 代码签名证书
        buildlog_path: "./fastlanelog",  # fastlane构建ipa的日志输出目录
        export_method: "app-store", # Xcode 9增加export_method标签
        output_directory: "/Users/xxx/Desktop")  # ipa输出目录

end
desc "Build a new version use the ceshi"
lane :ceshi do |op|
increment_version_number(version_number: op[:version])
increment_build_number(build_number: op[:version])


    set_info_plist_value(path: "./xxx/Info.plist",
                        key: "UIFileSharingEnabled",
                        value: true)

    set_info_plist_value(path: "./xxx/hostAddress.plist",
                        key: "host",
                        value: "https:/ceshiServer:xx/xxx/xxx")

    # 设置某些服务是否有效
    # 还可以使用modify_services,具体参考官网相关文档
    produce(
        enable_services:{
            push_notification: "off",
        }
    )

    # 将Development版本的.mobileprovision文件保存在里面,名称随意。
    update_project_provisioning(profile: "./provisions/development.mobileprovision")

    update_project_team(path: "xxx.xcodeproj",
                  teamid: "5JC8GZ432G")

    gym(# use_legacy_build_api: true,
        output_name: "ceshi",
        silent: true,
        clean: true,
        configuration: "Debug",
        buildlog_path: "./fastlanelog",
        codesigning_identity: "iPhone Developer: xxx (xxxxxxxxxx)",
        export_method: "development", # Xcode 9增加export_method标签
        output_directory: "/Users/xxx/Desktop"
  )
end

标签:version,xxx,fastlane,devops,value,number,从零开始,path,plist
来源: https://www.cnblogs.com/franzlistan/p/14622339.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有