Fastlane: the right way to add a device to the setup?

I use fastlane to handle initialization.

This is what I did:

match nuke development match nuke distribution 

then in the strip I have this for each package. If I need to provide:

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

When I want to download collateral, I have a strip that does this:

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

All this allows me to work and build perfectly on devices that were ALREADY on the portal during nuke.

How to update initialization correctly if I want to add a device?

I tried this:

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

This does not work.

I get this error:

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

The only thing that works every time I have to add a device is to destroy everything and start a new one.

What is the correct way to add a device without the need for nuke?

I use xcode8, I turned off automatic provisioning, for example, suggested by fastlane.

+19
source share
4 answers

Starting with version 2.8 fastlane, there is a new way to add a device via the command line

fastlane run register_device udid:"1234โ€ฆ890" name:"My new iPhone"

To update, for example, the developer provisioning profile that includes this device starts:

fastlane match development --force


To get the udid (serial number) of the connected phone, simply run the system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad" command system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad" system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad"

+26
source

You call the fastlane command to register a new device

 # 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. ) 

And after you need to call

 match development --force_for_new_devices 

Using the force_for_new_devices parameter, the match checks whether the number of devices has changed since the last match, and automatically generates a provisioning profile if necessary. You can also use force: true to re-generate the provisioning profile each time it starts.

UPDATE 12/20/2016 Or a more intuitive way.

  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 
+9
source

Just ran into this problem ... the 'refresh_profiles' command ran an error. Maybe outdated? This script worked fine for me:

 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 
+2
source

Update: if you are trying to add iPhone XS or XS Max (or a newer one), you need to add a dash after the eighth digit, otherwise it will not be successfully added (as the format changes for these two devices, and presumably iPad Pro in 2018 as well. For example, if your UDID / serial number is "123456789123456789123456" you need to add it as "12345678-9123456789123456" . "12345678-9123456789123456"

So, to add these devices, you can run:

 fastlane run register_device udid:"12345678-9123456789123456" name:"Bob iPhone XS Max" 
+2
source

All Articles