美文网首页
iOS超级签名之安装Spaceship

iOS超级签名之安装Spaceship

作者: JoeTong | 来源:发表于2020-08-14 13:47 被阅读0次

    确保ruby -v 版本

    sudo gem install fastlane

    完了运行fastlane Spaceship

    启动Spaceship,报错pry,执行 sudo gem install pry

    完成。

    启动  fastlane Spaceship

    require "spaceship"

    Spaceship.login('157262625@qq.com', 'panbO5498345')

    #参数传入true表示需要新增设备,例如:ruby UpdateProfile.rb true

    ifARGV[0] =="true"

        file = File.open("multiple-device-upload-ios.txt") #文本文件里录入的udid和设备名用tab分隔

        file.eachdo|line|

            arr = line.strip.split("\t")

            device = Spaceship.device.create!(name: arr[1], udid: arr[0])

            puts"add device: #{device.name} #{device.udid} #{device.model}"

        end

        devices = Spaceship.device.all

        profiles = Array.new

        profiles += Spaceship.provisioning_profile.development.all

        profiles += Spaceship.provisioning_profile.ad_hoc.all

        profiles.eachdo|p|

            puts"Updating #{p.name}"

            p.devices = devices

            p.update!

        end

    end

    dic = { "XXXAdHoc" => "773086ad-6b7b-4e57-85b7-08b577308e91.mobileprovision",

            "XXXDevelop" => "a7a85aa7-f359-4415-a8ed-3dacc31ea448.mobileprovision" }

    downloadProfiles = Array.new

    downloadProfiles += Spaceship.provisioning_profile.development.all

    downloadProfiles += Spaceship.provisioning_profile.ad_hoc.all

    downloadProfiles.eachdo|p|

        puts"Downloading #{p.name}"

        fileName = dic[p.name]

        File.write("/Users/joe/Desktop/qweee/", p.download)

    end

    添加设备并下载,在终端运行ruby UpdateProfile.rb true即可

    但是最后 File.write("/Users/joe/Desktop/qweee/", p.download) 却报错了,原文是File.write("/Users/ray/Library/MobileDevice/Provisioning Profiles/#{fileName}", p.download);

    解决:用

        File.write("/Users/joe/Desktop/随笔/MobileDevice/momo.mobileprovision", p.download)

    路径怎么改都是报错

    相关文章

      网友评论

          本文标题:iOS超级签名之安装Spaceship

          本文链接:https://www.haomeiwen.com/subject/eyygdktx.html