iOS client for Grain
grain.social
ios
photography
atproto
1# Development Setup
2
3## Prerequisites
4
5```bash
6brew install xcodegen just xcbeautify swiftformat swiftlint
7```
8
9## First-time setup
10
111. **Copy the env file**
12 ```bash
13 cp .env.example .env
14 ```
15 Fill in your `APPLE_TEAM_ID` (find it at developer.apple.com → Account → Membership).
16
172. **Generate the Xcode project**
18 ```bash
19 just generate
20 ```
21
223. **Run on simulator**
23 ```bash
24 just sim
25 ```
26
27## Building on a real device
28
29Plug in your iPhone, then:
30```bash
31just device <your-device-udid>
32```
33
34Find your UDID:
35```bash
36xcrun xctrace list devices
37```
38
39> **Note:** Device builds require your Apple ID to have certificate access on the team. If you're on an individual developer account, team members need to use TestFlight or Xcode directly with automatic signing.
40
41## Deploying a build
42
43```bash
44just release
45```
46
47This bumps the build number, archives, and uploads to App Store Connect. Builds are automatically distributed to the **Devs** internal TestFlight group after processing.
48
49## Environment variables
50
51| Variable | Description |
52|---|---|
53| `APPLE_TEAM_ID` | Apple Developer Team ID used for signing device builds and releases |
54
55`just` loads `.env` automatically. No shell changes needed.
56
57## Common commands
58
59| Command | Description |
60|---|---|
61| `just generate` | Regenerate Xcode project from `project.yml` |
62| `just sim` | Build + run on booted simulator (production API) |
63| `just sim-local` | Build + run on booted simulator (local API) |
64| `just device <udid>` | Build + install to plugged-in iPhone |
65| `just test` | Run tests |
66| `just format-fix` | Auto-fix formatting |
67| `just lint-fix` | Auto-fix lint violations |
68| `just release` | Bump build, archive, upload to App Store Connect |