- Creates workflow for building without Apple Developer Program - Uses Apple-Actions for certificate import - Outputs .app file as artifact for sideloading See ADHOC_BUILD_GUIDE.md for setup instructions
4 KiB
4 KiB
iOS Ad-Hoc Build Setup Guide
This guide walks you through setting up ad-hoc signing for your Bagsy iOS app without an Apple Developer Program membership.
Prerequisites
- Free Apple ID - Use your personal Apple ID
- Your iPhone 16 connected to Mac via USB
- GitHub account to store secrets
Step 1: Get Your iPhone UDID
- Connect iPhone 16 to Mac via USB
- Open Finder → Click on your iPhone in the sidebar
- Click the phone icon in the top bar of the Finder window
- Look for "Serial Number" or click on the info icon (ℹ️)
- Click on the serial number - it will change to show "UDID"
- Copy the UDID (it looks like:
00001234-0001234567ABCDEF)
Step 2: Create Signing Certificate (Mac)
# 1. Create a Certificate Signing Request (CSR)
cd ~/Documents
mkdir csr
cd csr
# This will create a public/private key pair
security create-keychain -p "BagsyKeychain" Bagsy.keychain
security set-keychain-settings -t 9600 -l Bagsy.keychain
# Generate the CSR
security keychain default -keychain ~/Library/Keychains/login.keychain
security find-certificate -c "Apple Development" login.keychain
# Use Keychain Access app:
# 1. Open Keychain Access
# 2. Menu: Keychain Access → Certificate Assistant → Request a Certificate Authority...
# 3. Choose "Saved to disk"
# 4. Enter your email and name
# 5. Save as "BagsySigningRequest.certSigningRequest"
Step 3: Get Free Certificate from Apple
- Go to https://developer.apple.com/account
- Sign in with your free Apple ID
- Click "Certificates, Identifiers & Profiles"
- Click "+" to create a new certificate
- Select "Apple Development" or "Apple Distribution"
- Upload your CSR file
- Download the certificate (
.cerfile)
Step 4: Convert to P12 (Mac)
# Open the .cer file by double-clicking to install to Keychain
# Then export as p12:
# Open Keychain Access, find your certificate
# Right click → Export → Save as "Bagsy.p12"
# Set a password (remember this!)
Step 5: Create Ad-Hoc Provisioning Profile (Mac)
- Go to https://developer.apple.com/account → Certificates
- Click "+" → Select "Ad Hoc"
- Choose your App ID (create if needed:
com.barnabas.bagsy) - Select your certificate from Step 3
- Add your iPhone UDID from Step 1
- Name it: "Bagsy Ad-Hoc"
- Download the
.mobileprovisionfile
Step 6: Setup GitHub Secrets
Go to your GitHub repo → Settings → Secrets → Actions and add:
| Secret Name | Value |
|---|---|
CERTIFICATE |
Base64 of your .p12 file: base64 -w0 Bagsy.p12 |
KEY_PASSWORD |
Password you set for keychain |
P12_PASSWORD |
Password you set when exporting p12 |
CERTIFICATE_NAME |
"Apple Distribution: Your Name (TEAMID)" or "Apple Development: Your Name (TEAMID)" |
PROVISIONING_PROFILE |
Base64 of mobileprovision: base64 -w0 Bagsy.mobileprovision |
PROFILE_NAME |
"Bagsy Ad-Hoc" |
Step 7: Run the Build
- Push to main branch, or
- Go to GitHub Actions → Build iOS Ad-Hoc → Run workflow
Generating Base64 Values
# Get base64 for certificate (Mac terminal)
base64 -w0 Bagsy.p12
# Copy output as CERTIFICATE secret
# Get base64 for provisioning profile
base64 -w0 Bagsy\ Ad-Hoc.mobileprovision
# Copy output as PROVISIONING_PROFILE secret
Note: This creates an unsigned build that can be installed on YOUR iPhone 16 only (because it's ad-hoc with your UDID embedded). To test, you'll need to either:
- Download the .app from GitHub Actions and sideload via Xcode
- Or use a tool like idevicelocation 管理与配置
Let me also update the workflow to be more correct: