Skip to content

Commit a975610

Browse files
authored
Update default save path for certificates and provisioning profile (#489)
1 parent 0896548 commit a975610

8 files changed

Lines changed: 43 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
Version 0.64.0
2+
-------------
3+
4+
This release contains changes from [PR #489](https://github.com/codemagic-ci-cd/cli-tools/pull/489).
5+
6+
**Features**
7+
- Update default argument values for tool `app-store-connect` to be consistent with Xcode 16.0+. This changes where downloaded signing files are saved by default.
8+
- Argument `--certificates-dir` defaults now to `~/Library/Developer/Xcode/UserData/Certificates`.
9+
- Argument `--profiles-dir` defaults now to `~/Library/Developer/Xcode/UserData/Provisioning Profiles`.
10+
- Update action `keychain add-certificates` argument `--certificate` to look up certificates from `~/Library/Developer/Xcode/UserData/Certificates`. Old certificates location remains also included in the default glob patterns.
11+
- Update action `xcode-project use-profiles` argument `--profile` to look up provisioning profiles from `~/Library/Developer/Xcode/UserData/Provisioning Profiles.` by default. Old certificates location remains also included in the default glob patterns.
12+
13+
**Docs**
14+
- Update docs for `app-store-connect`.
15+
- Update docs for `keychain add-certificates`.
16+
- Update docs for `xcode-project use-profiles`.
17+
118
Version 0.63.0
219
-------------
320

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "codemagic-cli-tools"
3-
version = "0.63.0"
3+
version = "0.64.0"
44
description = "CLI tools used in Codemagic builds"
55
authors = [{ name = "Priit Lätt", email = "priit@nevercode.io" }]
66
requires-python = ">=3.8,<4"

src/codemagic/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = "codemagic-cli-tools"
22
__description__ = "CLI tools used in Codemagic builds"
3-
__version__ = "0.63.0.dev"
3+
__version__ = "0.64.0.dev"
44
__url__ = "https://github.com/codemagic-ci-cd/cli-tools"
55
__licence__ = "GNU General Public License v3.0"

src/codemagic/models/certificate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939

4040

4141
class Certificate(JsonSerializable, RunningCliAppMixin, StringConverterMixin):
42-
DEFAULT_LOCATION = pathlib.Path(pathlib.Path.home(), "Library", "MobileDevice", "Certificates")
42+
# This location is not generally recognized by Apple in any way. Just keep it in sync with
43+
# the provisioning profiles directory.
44+
DEFAULT_LOCATION = pathlib.Path.home() / "Library" / "Developer" / "Xcode" / "UserData" / "Certificates"
45+
LEGACY_LOCATION = pathlib.Path.home() / "Library" / "MobileDevice" / "Certificates"
4346

4447
def __init__(self, certificate: x509.Certificate):
4548
if hasattr(certificate, "to_cryptography"):

src/codemagic/models/provisioning_profile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323

2424

2525
class ProvisioningProfile(JsonSerializable, RunningCliAppMixin, StringConverterMixin):
26-
DEFAULT_LOCATION = pathlib.Path(pathlib.Path.home(), "Library", "MobileDevice", "Provisioning Profiles")
26+
# Xcode versions up to 15.x expected profiles to be stored in '~/Library/MobileDevice/Provisioning Profiles'.
27+
# This is also where Xcode's auto-managed profiles were put. Since Xcode 16.0 profiles are stored in
28+
# '~/Library/Developer/Xcode/UserData/Provisioning Profiles' instead. Keep a reference to the old location
29+
# for backwards compatibility.
30+
DEFAULT_LOCATION = pathlib.Path.home() / "Library" / "Developer" / "Xcode" / "UserData" / "Provisioning Profiles"
31+
LEGACY_LOCATION = pathlib.Path.home() / "Library" / "MobileDevice" / "Provisioning Profiles"
2732

2833
def __init__(self, plist: Dict[str, Any]):
2934
self._plist = plist

src/codemagic/tools/_xcode_project/arguments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ class XcodeProjectArgument(cli.Argument):
134134
"default": (
135135
ProvisioningProfile.DEFAULT_LOCATION / "*.mobileprovision",
136136
ProvisioningProfile.DEFAULT_LOCATION / "*.provisionprofile",
137+
ProvisioningProfile.LEGACY_LOCATION / "*.mobileprovision",
138+
ProvisioningProfile.LEGACY_LOCATION / "*.provisionprofile",
137139
),
138140
},
139141
)

src/codemagic/tools/app_store_connect/arguments.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,20 @@ class AppStoreConnectArgument(cli.Argument):
522522
flags=("--certificates-dir",),
523523
type=pathlib.Path,
524524
description="Directory where the code signing certificates will be saved",
525-
argparse_kwargs={"required": False, "default": Certificate.DEFAULT_LOCATION},
525+
argparse_kwargs={
526+
"required": False,
527+
"default": Certificate.DEFAULT_LOCATION,
528+
},
526529
)
527530
PROFILES_DIRECTORY = cli.ArgumentProperties(
528531
key="profiles_directory",
529532
flags=("--profiles-dir",),
530533
type=pathlib.Path,
531534
description="Directory where the provisioning profiles will be saved",
532-
argparse_kwargs={"required": False, "default": ProvisioningProfile.DEFAULT_LOCATION},
535+
argparse_kwargs={
536+
"required": False,
537+
"default": ProvisioningProfile.DEFAULT_LOCATION,
538+
},
533539
)
534540

535541

src/codemagic/tools/keychain.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ class KeychainArgument(cli.Argument):
7474
"required": False,
7575
"nargs": "+",
7676
"metavar": "certificate-path",
77-
"default": (Certificate.DEFAULT_LOCATION / "*.p12",),
77+
"default": (
78+
Certificate.DEFAULT_LOCATION / "*.p12",
79+
Certificate.LEGACY_LOCATION / "*.p12",
80+
),
7881
},
7982
)
8083
CERTIFICATE_PASSWORD = cli.ArgumentProperties(

0 commit comments

Comments
 (0)