-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
59 lines (50 loc) · 2.45 KB
/
Copy pathjustfile
File metadata and controls
59 lines (50 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# iOS app — standard verbs (see global CLAUDE.md)
app := "Quietgram"
device_id := env_var_or_default("IOS_DEVICE_ID", "")
team_id := "467A4PRB8F"
# guard for recipes that target a physical device
_need-device:
@test -n "{{device_id}}" || { echo "set IOS_DEVICE_ID to your device UDID — find it via \`xcrun devicectl list devices\`"; exit 1; }
# regenerate the xcodeproj from project.yml (run after editing project.yml or adding files)
gen:
xcodegen generate
# open in Xcode for the normal edit/run loop
dev: gen
open {{app}}.xcodeproj
# unit tests on a simulator (no signing)
test: gen
xcodebuild -project {{app}}.xcodeproj -scheme {{app}} \
-destination "platform=iOS Simulator,name=iPhone 17" \
CODE_SIGNING_ALLOWED=NO test
# simulator smoke build (no signing) — CI-able correctness check
check: gen
xcodebuild -project {{app}}.xcodeproj -scheme {{app}} \
-destination "generic/platform=iOS Simulator" \
CODE_SIGNING_ALLOWED=NO build
# DEBUG build + install to device: automatic signing, 7-day validity, readable logs
build: _need-device gen
xcodebuild -project {{app}}.xcodeproj -scheme {{app}} \
-destination "platform=iOS,id={{device_id}}" \
-configuration Debug -allowProvisioningUpdates build
APP=$(ls -td ~/Library/Developer/Xcode/DerivedData/{{app}}-*/Build/Products/Debug-iphoneos/{{app}}.app | head -1) && \
xcrun devicectl device install app --device {{device_id}} "$APP"
# STABLE build + install: wildcard Ad Hoc profile, 1-year validity, no logs
deploy: _need-device gen
xcodebuild -project {{app}}.xcodeproj -scheme {{app}} \
-destination "platform=iOS,id={{device_id}}" \
-configuration Release \
CODE_SIGN_STYLE="Manual" \
CODE_SIGN_IDENTITY="Apple Distribution" \
PROVISIONING_PROFILE_SPECIFIER="Alexander Wildcard Ad Hoc" \
DEVELOPMENT_TEAM={{team_id}} \
clean build
APP=$(ls -td ~/Library/Developer/Xcode/DerivedData/{{app}}-*/Build/Products/Release-iphoneos/{{app}}.app | head -1) && \
xcrun devicectl device install app --device {{device_id}} "$APP"
# collect last 5m of device logs into ./logs/ (requires sudo; app must be a DEBUG install)
logs: _need-device
mkdir -p logs
sudo log collect --device-udid {{device_id}} --last 5m --output ./logs/{{app}}.logarchive
log show ./logs/{{app}}.logarchive \
--predicate 'process == "{{app}}"' \
--style compact > ./logs/{{app}}-logs.txt
@echo "wrote logs/{{app}}-logs.txt"