fastlane match regenerates iOS development profile, but does not include M1 macs

1.2k Views Asked by At

I am using match to handle our certs/profiles for iOS app. Our iOS app can run on M1 macs (as designed for iPad, not catalyst.). Match does regenerate the provisioning profiles and does include all new iOS devices, but excludes mac devices despite setting the "allow mac devices" switch to the on state. I don't see any flags or parameters for Fastlane Match that mention anything about including macs. Has anyone been able to work through this?

match(
  type: "development",
  git_url: ...,
  app_identifier: ..., 
  api_key: ...,
  verbose: true
  force: true
)

I found this post (which was closed)

UPDATE (Feb 09, 2024): Posting a follow up that Fastlane is now capable. I was successful using version 2.219.0, though I can't speak to earlier versions.

2

There are 2 best solutions below

0
On

I found a workaround if you are willing to locally modify a line of code for fastlane sigh.

First you need to find where fastlane is installed. For me (macOS) it is installed here: ~/.gem/gems/fastlane-2.206.2. You might have fastlane installed in your project folder $projectRoot/vendor/bundle/ruby/2.6.0/gems/fastlane-2.206.2.

Next you will modify a file in the sigh tool. Use a text editor to open the file: vim ~/.gem/gems/fastlane-2.206.2/sigh/lib/sigh/runner.rb.

Search for device_classes = . For me this was around line 272:

  device_classes = case Sigh.config[:platform].to_s
                   when 'ios'
                     [
                       Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPOD
                     ]
                   when 'tvos'
                     [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV]
                   when 'macos', 'catalyst'
                     [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
                   end

Under the case when 'ios' we will append a line: Spaceship::ConnectAPI::Device::DeviceClass::MAC. It will look like this:

  device_classes = case Sigh.config[:platform].to_s
                   when 'ios'
                     [
                       Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPOD,
                       Spaceship::ConnectAPI::Device::DeviceClass::MAC
                     ]
                   when 'tvos'
                     [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV]
                   when 'macos', 'catalyst'
                     [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
                   end

Save and quit.

Re-run fastlane match to regenerate your certificates like normal. Check your new provisioning profile on developer.apple.com. Go into edit mode, scroll down to the device list to see if it did include all iOS & macOS devices.

One final thing if you are still having trouble. (Still editing your provisioning profile) ensure that the "include mac devices" switch is checked.

include_mac_devices

I'm not sure if this is actually helpful as match regenerates the provisioning profile, but I thought I'd mention it. Maybe one of you can post back with an answer.

Note that you will need to repeat this modification each time install an update to fastlane.

2
On

Fastlane 2.211.0 is supposed to support this feature via the new parameter include_mac_in_profiles. Here is a link to the pull request (#20676).

I found that this failed to work for me. I included this parameter, had match regenerate my development profile, but the Apple Silicon macs were not included. I then went back to modifying fastlane as listed above, which did work.

I also tried setting both ENV vars to true, but no luck there.

The code to modify has changed a bit, so here is what needs to be modified now.

Open the file sigh/lib/sigh/runner.rb and find this:

if Sigh.config[:platform].to_s == 'ios' && Sigh.config[:include_mac_in_profiles]
    device_classes += [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC]
end

Modify it to include MAC as well:

if Sigh.config[:platform].to_s == 'ios' && Sigh.config[:include_mac_in_profiles]
    device_classes += [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC]
    device_classes += [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
end