Recently during the development it would require to test Apple Enclave with public/private key generation, since we are using Expo / React Native. I wanted to have the close enough build to the real app and don’t deliver the app to TestFlight by reducing the amount of time for the development.
Yes, used claude code to make the script but anyway it worked well for me and decided to share it.
Justfile
# iOS Build Configuration
app_name := "PushUP"
workspace := "ios/${app_name}.xcworkspace"
scheme := "${app_name}"
configuration := "Release"
archive_path := "build/${app_name}.xcarchive"
export_path := "build/ipa"
bundle_id := "co.bitscorp.pushup"
# Default recipe - shows available commands
default:
@just --list
# Deep clean (closes Xcode and cleans everything)
clean:
#!/usr/bin/env bash
set -e
echo "🧹 Deep cleaning (closing Xcode)..."
# Close Xcode if running
killall Xcode 2>/dev/null || true
sleep 2
# Clean everything
rm -rf build/
rm -rf ios/build/
rm -rf ios/Pods
rm -rf ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData/${app_name}*
echo "✅ Deep clean complete"
# Build without archiving (for testing)
build:
#!/usr/bin/env bash
set -euo pipefail
echo "🔨 Building project..."
# Source Xcode environment for Node binary
if [ -f ios/.xcode.env.local ]; then
source ios/.xcode.env.local
elif [ -f ios/.xcode.env ]; then
source ios/.xcode.env
fi
export NODE_BINARY
xcodebuild build \
-workspace {{workspace}} \
-scheme {{scheme}} \
-configuration {{configuration}} \
-sdk iphoneos \
-destination 'generic/platform=iOS' \
-allowProvisioningUpdates \
CODE_SIGN_STYLE=Automatic \
ONLY_ACTIVE_ARCH=NO
# Archive the iOS app
archive:
#!/usr/bin/env bash
set -euo pipefail
echo "📦 Creating archive..."
# Source Xcode environment for Node binary
if [ -f ios/.xcode.env.local ]; then
source ios/.xcode.env.local
elif [ -f ios/.xcode.env ]; then
source ios/.xcode.env
fi
export NODE_BINARY
xcodebuild archive \
-workspace {{workspace}} \
-scheme {{scheme}} \
-configuration {{configuration}} \
-sdk iphoneos \
-destination 'generic/platform=iOS' \
-archivePath {{archive_path}} \
-allowProvisioningUpdates \
CODE_SIGN_STYLE=Automatic \
ONLY_ACTIVE_ARCH=NO
# Extract IPA from archive without code signing (for Sideloadly)
export-unsigned:
#!/usr/bin/env bash
set -euo pipefail
echo "📱 Creating unsigned IPA from archive for Sideloadly..."
if [ ! -d {{archive_path}} ]; then
echo "❌ Archive not found at {{archive_path}}"
exit 1
fi
# Find the .app in the archive
APP_PATH=$(find {{archive_path}}/Products/Applications -name "*.app" -maxdepth 1 | head -n 1)
if [ -z "$APP_PATH" ]; then
echo "❌ No .app found in archive"
exit 1
fi
APP_NAME=$(basename "$APP_PATH")
IPA_NAME="${APP_NAME%.app}.ipa"
echo "Found app: $APP_NAME"
# Create Payload directory
rm -rf {{export_path}}/Payload
mkdir -p {{export_path}}/Payload
# Copy .app to Payload
cp -r "$APP_PATH" {{export_path}}/Payload/
# Create IPA (which is just a zip file)
cd {{export_path}}
rm -f "$IPA_NAME"
zip -r "$IPA_NAME" Payload
rm -rf Payload
echo "✅ Unsigned IPA created at {{export_path}}/$IPA_NAME"
# Full build: clean, archive, and export for Development
ios: build archive export-unsigned
@echo "✅ Done at {{export_path}}"J
just ios
And then download Sideloadly! app for mac and install it to your iPhone by signing with your developer account.
Thank you for reading!
Top comments (0)