【问题标题】:Fastlane: proper way to add a device to provisioning?Fastlane:将设备添加到配置的正确方法?
【发布时间】:2016-09-23 17:21:44
【问题描述】:

我正在使用 fastlane 来处理配置。

这就是我所做的:

match nuke development 
match nuke distribution

然后在一个通道中,我需要为每个 bundleId 提供这个:

match(type: "development", app_identifier: "com.myCompany.myApp", force_for_new_devices: true)

当我想下载配置时,我有一个执行此操作的通道:

match(type: "development", app_identifier: "com.myCompany.myApp", readonly: true)

所有这些让我可以在 nuke 时已经在门户中的设备上正常工作和构建。

如果我想添加设备,如何正确更新配置?

我试过了:

match development --force_for_new_devices true -a com.myCompany.myApp

它不起作用。

我收到此错误:

Provisioning profile '82afbd5b-9f19-4c78-b3ac-56a3565ce3f2' is not available on the Developer Portal

每次我必须添加设备时,唯一有效的方法就是对所有内容进行核对并重新开始。

不用核弹就可以添加设备的正确方法是什么??

我使用的是 Xcode 8,我禁用了 fastlane 建议的自动配置。

【问题讨论】:

    标签: ios fastlane


    【解决方案1】:

    从 fastlane 2.8 版开始,有一种通过命令行添加设备的新方法

    fastlane run register_device udid:"1234…890" name:"My new iPhone"

    刷新例如包含此设备运行的开发者配置文件:

    fastlane match development --force


    要获取已连接手机的 udid(序列号),只需运行命令 system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad"

    【讨论】:

      【解决方案2】:

      你调用fastlane命令注册新设备

      # Simply provide a list of devices as a Hash
      register_devices(
        devices: {
          'Luka iPhone 6' => '1234567890123456789012345678901234567890',
          'Felix iPad Air 2' => 'abcdefghijklmnopqrstvuwxyzabcdefghijklmn',
        }
      )
      
      # Alternatively provide a standard UDID export .txt file, see the Apple Sample (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)
      register_devices(
        devices_file: './devices.txt'
      )
      
      # Advanced
      register_devices(
        devices_file: './devices.txt', # You must pass in either `devices_file` or `devices`.
        team_id: 'XXXXXXXXXX',         # Optional, if you're a member of multiple teams, then you need to pass the team ID here.
        username: 'luka@goonbee.com'   # Optional, lets you override the Apple Member Center username.
      )
      

      之后你需要打电话

      match development --force_for_new_devices
      

      通过使用 force_for_new_devices 参数,match 将检查自上次运行 match 以来设备计数是否发生变化,并在必要时自动重新生成配置文件。您还可以使用 force: true 在每次运行时重新生成配置文件。

      2016 年 12 月 20 日更新 或者更直观的方式

       desc "Register new device"
        lane :register_new_device do  |options|
            device_name = prompt(text: "Enter the device name: ")
            device_udid = prompt(text: "Enter the device UDID: ")
            device_hash = {}
            device_hash[device_name] = device_udid
            register_devices(
                             devices: device_hash
                             )
          refresh_profiles
        end
      

      【讨论】:

      • 我应该把那些register_devices 命令放在哪里?在Matchfile ?
      • 我在 Fastfile 中。在我呼叫这条车道之后。
      • re your edit - 我猜refresh_profiles 是一条运行match 的车道,就像在这个线程中一样? github.com/fastlane/fastlane/issues/1999
      • 是的,完全正确。它通过 Match 刷新所有配置文件 Debug、Adhoc、Appstore
      【解决方案3】:

      更新:如果您尝试添加 iPhone XS 或 XS Max(或更新版本),您需要在第八位数字后添加破折号,否则将无法成功添加(因为这些的格式已更改两台设备,大概还有 2018 年的 iPad Pro)。例如,如果您的 UDID/序列号是 "123456789123456789123456",您需要将其添加为 "12345678-9123456789123456"

      所以,要添加这些设备,您可以运行:

      fastlane run register_device udid:"12345678-9123456789123456" name:"Bob's iPhone XS Max"
      

      【讨论】:

        【解决方案4】:

        刚刚遇到这个问题...“refresh_profiles”命令引发了错误。可能会被弃用?这个脚本非常适合我:

        desc "Register new devices"
        lane :register do
          device_name = prompt(text: "Enter the device name: ")
          device_udid = prompt(text: "Enter the device UDID: ")
          device_hash = {}
          device_hash[device_name] = device_udid
          register_devices(devices: device_hash)
          match(force: true)
        end
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-05-01
          • 2013-01-27
          • 2011-04-04
          • 2022-12-23
          • 2020-10-10
          • 1970-01-01
          • 2015-03-09
          相关资源
          最近更新 更多