-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-iphone.sh
More file actions
executable file
·74 lines (62 loc) · 2.51 KB
/
deploy-iphone.sh
File metadata and controls
executable file
·74 lines (62 loc) · 2.51 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -e
# Hone IDE — build, sign, and deploy to iPhone
# Usage: ./deploy-iphone.sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PERRY_DIR="$(cd "$SCRIPT_DIR/../../perry" && pwd)"
APP_TS="$SCRIPT_DIR/src/app.ts"
APP_BUNDLE="$SCRIPT_DIR/Hone.app"
# Signing config
SIGN_IDENTITY="Apple Development: Ralph Kuepper (372EYFG3C5)"
TEAM_ID="K6UW5YV9F7"
BUNDLE_ID="com.hone.ide"
PROVISION_PROFILE="$HOME/Library/Developer/Xcode/DerivedData/HoneSigner-gwsadbjvejkvbcetbfuwksejbgav/Build/Products/Debug-iphoneos/Hone.app/embedded.mobileprovision"
# Find connected iPhone
DEVICE_ID=$(xcrun devicectl list devices 2>&1 | grep "iPhone" | grep "available" | head -1 | grep -oE '[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}')
if [ -z "$DEVICE_ID" ]; then
echo "Error: No available iPhone found. Connect your device and try again."
exit 1
fi
echo "==> iPhone: $DEVICE_ID"
# 1. Build Perry iOS device library
echo "==> Building Perry UI (iOS device)..."
cd "$PERRY_DIR"
CARGO_PROFILE_RELEASE_LTO=off cargo build --release -p perry-ui-ios --target aarch64-apple-ios 2>&1 | tail -1
# 2. Compile TypeScript → native iOS binary
echo "==> Compiling Hone IDE..."
./target/release/perry compile "$APP_TS" --target ios --output "$SCRIPT_DIR/Hone" 2>&1 | tail -1
# 3. Embed provisioning profile
if [ ! -f "$PROVISION_PROFILE" ]; then
echo "Error: Provisioning profile not found at $PROVISION_PROFILE"
echo "Run the HoneSigner Xcode project first (see README)."
exit 1
fi
echo "==> Embedding provisioning profile..."
cp "$PROVISION_PROFILE" "$APP_BUNDLE/embedded.mobileprovision"
# 4. Code sign
echo "==> Signing..."
ENTITLEMENTS_FILE=$(mktemp /tmp/hone-entitlements.XXXXXX.plist)
cat > "$ENTITLEMENTS_FILE" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>${TEAM_ID}.${BUNDLE_ID}</string>
<key>com.apple.developer.team-identifier</key>
<string>${TEAM_ID}</string>
<key>get-task-allow</key>
<true/>
</dict>
</plist>
PLIST
codesign --force --sign "$SIGN_IDENTITY" \
--entitlements "$ENTITLEMENTS_FILE" \
--timestamp=none "$APP_BUNDLE"
rm -f "$ENTITLEMENTS_FILE"
# 5. Install and launch
echo "==> Installing on iPhone..."
xcrun devicectl device install app --device "$DEVICE_ID" "$APP_BUNDLE" 2>&1 | tail -3
echo "==> Launching..."
xcrun devicectl device process launch --device "$DEVICE_ID" "$BUNDLE_ID" 2>&1 | tail -1
echo "==> Done!"