Native iOS charging monitor that alerts you when your device stops charging unexpectedly.
You can build and distribute to TestFlight using Apple's free Xcode Cloud service - no Mac required!
- Go to github.com/new
- Create a new repo called
ChargeGuard-iOS - Keep it private if you prefer
Using GitHub Desktop, VS Code, or command line:
cd ChargeGuard
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/ChargeGuard-iOS.git
git push -u origin main- Go to App Store Connect
- Click My Apps → + → New App
- Fill in:
- Platform: iOS
- Name: ChargeGuard
- Primary Language: English
- Bundle ID: Click + to register new:
com.yourname.chargeguard - SKU:
chargeguard-001
- Click Create
- In App Store Connect, go to your app
- Click Xcode Cloud tab (in the sidebar)
- Click Get Started
- Click Connect to a Git repository
- Select GitHub and authorize Apple
- Select your
ChargeGuard-iOSrepository - Choose the
mainbranch
When prompted to configure the workflow:
- Product: ChargeGuard
- Actions:
- Build → Archive
- Post-Actions → TestFlight (Internal Testing)
- Start Conditions: Push to
mainbranch - Environment:
- Xcode Version: Latest Release
- macOS Version: Latest
Before the first build, update the Bundle ID in ChargeGuard.xcodeproj/project.pbxproj.
Find and replace:
com.yourcompany.ChargeGuard
with your actual Bundle ID (e.g.):
com.yourname.chargeguard
Commit and push the change.
Push any commit to trigger the build, or click Start Build manually in Xcode Cloud.
- Go to TestFlight tab in App Store Connect
- Under Internal Testing, click + to add testers
- Or create an External Testing group for a public link
"No schemes found": The project needs a shared scheme. See the xcshareddata folder included.
Signing errors: In App Store Connect → Xcode Cloud → Settings, make sure automatic signing is enabled.
Build fails: Check the logs in Xcode Cloud for specific errors.
Rent a cloud Mac at macincloud.com (~$20/mo) if Xcode Cloud gives issues.
- Real-time battery level monitoring
- Instant alerts when charging stops
- Local notifications (works in background)
- Vibration feedback
- Audio alerts
- Clean SwiftUI interface matching your web version
iOS limits background execution, but the app handles this by:
- Using
UIDevice.batteryStateDidChangeNotification(system-triggered) - Requesting background audio session
- Sending local notifications when backgrounded
The notification system ensures you're alerted even if the app is suspended.
"Battery level shows 0%": Battery monitoring only works on real devices, not the Simulator.
"No notifications": Make sure you've granted notification permissions in Settings.
"App suspends in background": This is normal iOS behavior. The notification will still fire when charging stops.