codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
244 stars 42 forks source link

`list-bundle-ids` says that a Bundle ID is only iOS but should be universal #314

Closed nilsreichardt closed 1 year ago

nilsreichardt commented 1 year ago

When I execute the following command:

app-store-connect list-bundle-ids \
  --bundle-id-identifier de.codingbrain.sharezone.app \
  --strict-match-identifier

I'm getting this result:

Found 1 Bundle ID matching specified filters: identifier=de.codingbrain.sharezone.app.
-- Bundle ID --
Id: 999P7P39D8
Type: bundleIds
Identifier: de.codingbrain.sharezone.app
Name: Sharezone
Platform: IOS
Seed id: AJ3PMPVZ7H

It says that the Platform is IOS. However, the Platform should be universal.

This is a screenshot from the Developer Console which shows for Platform "iOS, macOS, tvOS, watchOS".

image

Is this an issue in the CLI or in our App Store configurations? This should be reason why we can't build macOS build with Codemagic because the signing fails.

priitlatt commented 1 year ago

@nilsreichardt, thanks for the report. I'll try to look into it next week.

priitlatt commented 1 year ago

@nilsreichardt, apparently Apple Developer Portal web interface does not differentiate universal bundle identifiers from platform specific ones.

Check these two examples. The bundle id depicted on first two screenshots was created many years ago explicitly for iOS platform. Web interface reflects that it can be used with all platforms now.

Screenshot 2023-03-13 at 14 21 21

But API response still returns iOS specific platform type:

Screenshot 2023-03-13 at 14 20 50

For a more recent bundle identifier that was originally created with universal platform, the web interface shows exactly the same platform info as for the former bundle id.

Screenshot 2023-03-13 at 14 21 11

But it has a different value in API response for attributes.platform.

Screenshot 2023-03-13 at 14 20 52

Given that, I'd say that actually everything works in an expected manner. However, it might be worth checking if oldschool platform-specific bundle identifiers can now be used as universal, ie can I use iOS bundle id to sign macOS app or vice versa?

nilsreichardt commented 1 year ago

Thanks for your help @priitlatt ❤️

However, it might be worth checking if oldschool platform-specific bundle identifiers can now be used as universal, ie can I use iOS bundle id to sign macOS app or vice versa?

Good idea! This seems to work 💯

What works for me:

app-store-connect fetch-signing-files $BUNDLE_ID \
  --platform IOS \
  --type MAC_APP_STORE \
  --create \
  --strict-match-identifier

It's important to use --strict-match-identifier so that the tools creates a new profile (otherwise it tries to use the one from our dev environment). Also MAC_APP_DEVELOPMENT has not worked for me, it need to be MAC_APP_STORE.

My logs:

Found 1 Bundle ID matching specified filters: identifier=de.codingbrain.sharezone.app, platform=IOS.
- Sharezone de.codingbrain.sharezone.app (999P7P39D8)

Found 1 Signing Certificate matching specified filters: certificateType=DISTRIBUTION,MAC_APP_DISTRIBUTION.
Filtered out 1 Signing Certificate for given private key
- Apple Distribution: Sharezone UG (haftungsbeschraenkt) (N548854UP6)

Get Profiles for Bundle ID 999P7P39D8
Did not find any Profiles for Bundle ID 999P7P39D8 matching specified filters: profileState=ACTIVE, profileType=MAC_APP_STORE.
Did not find any Profiles that contain Signing Certificate Apple Distribution: Sharezone UG (haftungsbeschraenkt) (N548854UP6)
Found 4 Devices matching specified filters: platform=IOS, status=ENABLED.
Found 1 Signing Certificate matching specified filters: certificateType=DISTRIBUTION,MAC_APP_DISTRIBUTION.
Get Bundle ID 999P7P39D8
Creating new Profile: name: 'Sharezone mac_app_store 1678715334', profile type: MAC_APP_STORE, bundle id: 999P7P39D8, certificates: ['N548854UP6']
Created Profile 8VZS75DLB3

MAC verified OK
Saved Signing Certificate Apple Distribution: Sharezone UG (haftungsbeschraenkt) (N548854UP6) to /Users/nils/Library/MobileDevice/Certificates/DISTRIBUTION_N548854UP6_j43zqnh5.p12
Saved Profile MAC_APP_STORE Sharezone mac_app_store 1678715334 (8VZS75DLB3) to '/Users/nils/Library/MobileDevice/Provisioning Profiles/MAC_APP_STORE_8VZS75DLB3_guk6hta2.provisionprofile'