Skip to content

Commit 2700906

Browse files
authored
Merge pull request #732 from quoid/build/update-xcconfig-files-and-dev-doc
build: update xcconfig files and dev doc require team id
2 parents c4a57a7 + 65159a5 commit 2700906

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

docs/dev.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Reviewing the template will help you understand the composition of the project.
2222

2323
- [`Node.js`](https://nodejs.org/)
2424
- [`Xcode`](https://geo.itunes.apple.com/app/id497799835)
25+
- `Developer Team ID` (i.e. Apple Account, see [Xcode section](#xcode))
2526

2627
# Dev
2728

@@ -30,6 +31,10 @@ Reviewing the template will help you understand the composition of the project.
3031

3132
# Build
3233

34+
> [!NOTE]
35+
> Before building the app with Xcode make sure you create the `.dev.xcconfig` files [below](#xcconfig) and fill in your `Developer Team ID`.
36+
> Otherwise `App groups` related functions will not work properly.
37+
3338
- `npm run build:mac` [^1][^2]
3439
- `cd ./xcode`
3540
- `xcodebuild -scheme Mac` [^1][^2][^3] or build with `Xcode` App
@@ -42,32 +47,27 @@ Reviewing the template will help you understand the composition of the project.
4247

4348
# Xcode
4449

50+
Please note that a developer account is required, which can be a free Apple Account that has agreed to the Apple Developer Agreement. This is required to obtain a `Team ID` and use the `App groups` capability.
51+
4552
### Configurations
4653

47-
The Xcode project contains two configurations, which have independent `xcconfig` configuration files, and can run on your local at the same time without conflicts.
54+
The Xcode project contains several configurations, which have independent `xcconfig` configuration files, and can run on your local at the same time without conflicts.
55+
56+
- `Vite`: for vite real-time development.
4857

49-
- `Debug`: No developer account is required, that is `Sign to Run Locally` by default, which will speed up the build during development. This is convenient for developers without an account, and contributors who only need to do simple local debugging.
58+
- `Debug`: for development and debugging.
5059

51-
- `Release`: A developer account is required, which means it can be used for distribution as well as running on real iOS/iPadOS devices. You will need to override your developer account information in `xcconfig` to complete the build.
60+
- `Release`: for building and distributing.
5261

5362
### xcconfig
5463

5564
All `xcconfig` files are in the [`/xcode/xcconfig/`](../xcode/xcconfig) directory. Each `.xcconfig` file can be overridden by `.dev.xcconfig` in the same path, they will be ignored by `git`, so you can override any build settings locally.
5665

57-
For example, you can create an `Userscripts-Release.dev.xcconfig` file to override [`Userscripts-Release.xcconfig`](../xcode/xcconfig/Userscripts-Release.xcconfig) and fill in your own developer account information there:
58-
59-
`Userscripts-Release.dev.xcconfig`
60-
61-
```
62-
DEVELOPMENT_TEAM = XXXXXXXXXX
63-
```
64-
65-
Another example, if you want `Debug` builds to be also signed, so instead of enabling `Allow Unsigned Extensions` every time in Safari, you can create:
66+
For example, you can create an `Userscripts-Debug.dev.xcconfig` file to override [`Userscripts-Debug.xcconfig`](../xcode/xcconfig/Userscripts-Debug.xcconfig) and fill in your own developer account `Team ID` there:
6667

6768
`Userscripts-Debug.dev.xcconfig`
6869

6970
```
70-
CODE_SIGN_IDENTITY = Apple Development
7171
DEVELOPMENT_TEAM = XXXXXXXXXX
7272
```
7373

@@ -79,4 +79,4 @@ Note that all existing `.xcconfig` files already include `.dev.xcconfig` files o
7979

8080
# About
8181

82-
[Userscripts](https://github.com/quoid/userscripts) @ 2018-2023
82+
[Userscripts](https://github.com/quoid/userscripts) @ 2018-2024

xcode/xcconfig/Userscripts-Debug.xcconfig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © Userscripts
44
CURRENT_PROJECT_VERSION = 1
55
MARKETING_VERSION = 1.0.0
66

7-
// Sign to Run Locally
8-
CODE_SIGN_IDENTITY = -
7+
// Development
8+
CODE_SIGN_IDENTITY = Apple Development
9+
// Developer Team ID
10+
DEVELOPMENT_TEAM = XXXXXXXXXX
911
// Organization Identifier
1012
ORG_IDENTIFIER = dev.debug
1113
// Application Identifier
@@ -14,7 +16,7 @@ APP_IDENTIFIER = $(ORG_IDENTIFIER).userscripts
1416
EXT_IDENTIFIER = $(APP_IDENTIFIER).ext.safari
1517
// App Groups and Group Containers
1618
IOS_SHARED_GID = group.$(ORG_IDENTIFIER).userscripts
17-
MAC_SHARED_GID = 00000.$(ORG_IDENTIFIER).userscripts
19+
MAC_SHARED_GID = $(DEVELOPMENT_TEAM).$(ORG_IDENTIFIER).userscripts
1820
// App URL Scheme
1921
APP_URL_SCHEME = userscriptsdebug
2022

xcode/xcconfig/Userscripts-Vite.xcconfig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © Userscripts
44
CURRENT_PROJECT_VERSION = 2
55
MARKETING_VERSION = 2.0.0
66

7-
// Sign to Run Locally
8-
CODE_SIGN_IDENTITY = -
7+
// Development
8+
CODE_SIGN_IDENTITY = Apple Development
9+
// Developer Team ID
10+
DEVELOPMENT_TEAM = XXXXXXXXXX
911
// Organization Identifier
1012
ORG_IDENTIFIER = dev.vite
1113
// Application Identifier
@@ -14,7 +16,7 @@ APP_IDENTIFIER = $(ORG_IDENTIFIER).userscripts
1416
EXT_IDENTIFIER = $(APP_IDENTIFIER).ext.safari
1517
// App Groups and Group Containers
1618
IOS_SHARED_GID = group.$(ORG_IDENTIFIER).userscripts
17-
MAC_SHARED_GID = 00000.$(ORG_IDENTIFIER).userscripts
19+
MAC_SHARED_GID = $(DEVELOPMENT_TEAM).$(ORG_IDENTIFIER).userscripts
1820
// App URL Scheme
1921
APP_URL_SCHEME = userscripts-vite
2022

0 commit comments

Comments
 (0)