Fastlane 及 Net::ReadTimeout with #<TCPSocket:(closed)> 报错

Fastlane 自动构建

注解: 本文主要围绕 iOS 自动编译打包发布蒲公英配置, &&,在 终端 如何使用命令

1. 目录: fastlane/Fastfile

lane :beta do
    time = Time.new.strftime("%Y%m%d") #获取时间格式
    version = get_version_number #获取版本号
    ipaName = "Release_#{version}_#{time}.ipa" # 输出后的ipa的名字
    
    gym(
        scheme:"Optimus",  #项目名称
        export_method:"enterprise", #打包的类型
        configuration:"Release", #模式,默认Release,还有Debug
        output_name:"#{ipaName}", #输出的包名
        output_directory:"~/Desktop" #输出的位置
    )

    pgyer(
        api_key: "cxxxxe", 
        user_key: "6xxxxc", 
        update_description: "歩羡仙 with MBP in #{time}"
    )
  end

2. 命令使用: fastlane beta

打开终端, 并在app所在目录(以 app-ios 为文件目录举例)输入, 按回车键即可)

mac@mbp app-ios % fastlane beta

来一个分隔符吧


毕竟

高潮要来了


3. 花里胡哨

因为最近自动构建报Net::ReadTimeout with #<TCPSocket:(closed)> ;
(虽然报异常,但是打包且发布到pgyer平台正常)
分析: 使用新创建的项目打包则没有报异常, 可能因为包本身大小过大,以及网络上传限制 ;
结论: 使用 curl 命令替换;

改进版 curl命令 sh脚本方式

lane :beta do
    time = Time.new.strftime("%Y%m%d") #获取时间格式
    version = get_version_number #获取版本号
    ipaName = "Release_#{version}_#{time}.ipa" # 输出后的ipa的名字
    
    gym(
        scheme:"Optimus",  #项目名称
        export_method:"enterprise", #打包的类型
        configuration:"Release", #模式,默认Release,还有Debug
        output_name:"#{ipaName}", #输出的包名
        output_directory:"~/Desktop" #输出的位置
    )

    sh "curl -F 'file=@pathto/app.ipa' -F 'uKey=userkey in pgyer ' -F '_api_key=apikey in pgyer' http://www.pgyer.com/apiv1/app/upload -F 'updateDescription=test update by 歩羡仙'"

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

推荐阅读更多精彩内容