Fastlane: proper way to add a device to provisioning?

zumzum picture zumzum · Sep 23, 2016 · Viewed 13.6k times · Source

I am using fastlane to handle provisioning.

This is what I did:

match nuke development 
match nuke distribution

then in a lane I have this for each bundleId I need to provision for:

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

When I want to download the provisioning I have a lane that does this:

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

All this lets me work and build fine on devices that were ALREADY in the portal at the time of nuke.

How do I update provisioning correctly if I want to add a device?

I tried this:

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

It 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 nuke everything and start fresh.

What's the proper way to add a device without having to nuke??

I am using xcode8, I disabled the automatic provisioning like suggested by fastlane.

Answer

David Boho picture David Boho · May 23, 2018

Since fastlane version 2.8 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 refresh e.g. the the developer provision profile to include this device run:

fastlane match development --force


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