A minimal iOS app that shows upcoming train departures for your commute. Automatically detects whether you're at home or work and shows departures in the right direction.
Uses 511.org Bay Area transit data (BART, Caltrain, Muni, etc.)
- Location-based: shows departures from the nearest configured station
- Auto-direction: figures out if you're going to work or home
- Real-time data with live indicators
- Big, readable departure times
- Pull to refresh + auto-refresh every 30 seconds
- Go to 511.org/open-data
- Sign up for a free account
- Request an API token for Transit data
- Copy your API key
You'll need stop codes for your origin and destination stations.
BART stations: BART Stop Codes
- Example:
MONT(Montgomery),DALY(Daly City),EMBR(Embarcadero)
Caltrain stations: Check 511.org GTFS data
- Example:
70011(San Francisco),70261(Mountain View)
Station coordinates: Use Google Maps to get lat/lon for each station.
- Open Leave Already app
- Tap "Get Started" or gear icon
- Enter your 511.org API key
- Add a route with:
- Route name (e.g., "Commute")
- Transit agency (BART, Caltrain, etc.)
- Line ID (optional - filters to specific line)
- Origin station: stop code, name, lat, lon
- Destination station: stop code, name, lat, lon
- macOS with Xcode Command Line Tools
- Apple Developer account
- App Store Connect access
Edit LeaveAlready.xcodeproj/project.pbxproj and update:
DEVELOPMENT_TEAM= Your Team ID (find in Apple Developer portal)PRODUCT_BUNDLE_IDENTIFIER= Your unique bundle ID (e.g.,com.yourname.LeaveAlready)
Or set via command line:
xcodebuild -project LeaveAlready.xcodeproj \
-scheme LeaveAlready \
-configuration Release \
DEVELOPMENT_TEAM="YOUR_TEAM_ID" \
PRODUCT_BUNDLE_IDENTIFIER="com.yourname.LeaveAlready"- Go to App Store Connect
- My Apps → + → New App
- Fill in:
- Platform: iOS
- Name: Leave Already (or your preferred name)
- Bundle ID: Match what you set above
- SKU: Any unique string (e.g.,
leave-001)
# Clean build folder
xcodebuild clean -project LeaveAlready.xcodeproj -scheme LeaveAlready
# Build archive
xcodebuild archive \
-project LeaveAlready.xcodeproj \
-scheme LeaveAlready \
-configuration Release \
-archivePath build/LeaveAlready.xcarchive \
-destination "generic/platform=iOS" \
DEVELOPMENT_TEAM="YOUR_TEAM_ID" \
CODE_SIGN_STYLE=AutomaticCreate ExportOptions.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>method</key>
<string>app-store-connect</string>
<key>teamID</key>
<string>YOUR_TEAM_ID</string>
<key>uploadSymbols</key>
<true/>
<key>destination</key>
<string>upload</string>
</dict>
</plist>Export the archive:
xcodebuild -exportArchive \
-archivePath build/LeaveAlready.xcarchive \
-exportPath build/export \
-exportOptionsPlist ExportOptions.plistUsing altool (older method):
xcrun altool --upload-app \
-f build/export/LeaveAlready.ipa \
-t ios \
-u "your@apple.id" \
-p "@keychain:AC_PASSWORD"Using notarytool / Transporter (recommended):
xcrun notarytool submit build/export/LeaveAlready.ipa \
--apple-id "your@apple.id" \
--team-id "YOUR_TEAM_ID" \
--password "@keychain:AC_PASSWORD"Or use the Transporter app from the Mac App Store.
- Go to App Store Connect → Your App → TestFlight
- Wait for build processing (usually 5-15 minutes)
- Add yourself as internal tester
- Install via TestFlight app on your iPhone
Save as build.sh:
#!/bin/bash
set -e
TEAM_ID="YOUR_TEAM_ID"
BUNDLE_ID="com.yourname.LeaveAlready"
echo "Building Leave Already..."
xcodebuild clean archive \
-project LeaveAlready.xcodeproj \
-scheme LeaveAlready \
-configuration Release \
-archivePath build/LeaveAlready.xcarchive \
-destination "generic/platform=iOS" \
DEVELOPMENT_TEAM="$TEAM_ID" \
PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
CODE_SIGN_STYLE=Automatic
echo "Exporting IPA..."
xcodebuild -exportArchive \
-archivePath build/LeaveAlready.xcarchive \
-exportPath build/export \
-exportOptionsPlist ExportOptions.plist
echo "Done! IPA at build/export/LeaveAlready.ipa"
echo "Upload with: xcrun altool --upload-app -f build/export/LeaveAlready.ipa -t ios -u YOUR_APPLE_ID -p @keychain:AC_PASSWORD"Store your app-specific password in Keychain for automated uploads:
xcrun notarytool store-credentials "AC_PASSWORD" \
--apple-id "your@apple.id" \
--team-id "YOUR_TEAM_ID"BART: Daly City ↔ Montgomery
- Route Name:
BART Commute - Agency:
BART - Line ID: (leave empty for all lines)
- Origin:
DALY,Daly City,37.7063,-122.4692 - Destination:
MONT,Montgomery,37.7894,-122.4013
Caltrain: SF ↔ Mountain View
- Route Name:
Caltrain Commute - Agency:
Caltrain - Line ID: (leave empty)
- Origin:
70011,San Francisco,37.7765,-122.3943 - Destination:
70261,Mountain View,37.3944,-122.0768
"API key not set" - Go to Settings and enter your 511.org API key
"No upcoming departures" - Check that your stop code is correct and trains are running
Location not updating - Make sure location permissions are enabled in iOS Settings
Build fails with signing error - Verify your Team ID and bundle identifier match App Store Connect
MIT