Skip to content

thomasleetech/ChargeGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ChargeGuard iOS App

Native iOS charging monitor that alerts you when your device stops charging unexpectedly.

Building WITHOUT a Mac (Xcode Cloud)

You can build and distribute to TestFlight using Apple's free Xcode Cloud service - no Mac required!

Step 1: Create GitHub Repository

  1. Go to github.com/new
  2. Create a new repo called ChargeGuard-iOS
  3. Keep it private if you prefer

Step 2: Push This Code to GitHub

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

Step 3: Create App in App Store Connect

  1. Go to App Store Connect
  2. Click My Apps+New App
  3. Fill in:
    • Platform: iOS
    • Name: ChargeGuard
    • Primary Language: English
    • Bundle ID: Click + to register new: com.yourname.chargeguard
    • SKU: chargeguard-001
  4. Click Create

Step 4: Set Up Xcode Cloud

  1. In App Store Connect, go to your app
  2. Click Xcode Cloud tab (in the sidebar)
  3. Click Get Started
  4. Click Connect to a Git repository
  5. Select GitHub and authorize Apple
  6. Select your ChargeGuard-iOS repository
  7. Choose the main branch

Step 5: Configure the Workflow

When prompted to configure the workflow:

  1. Product: ChargeGuard
  2. Actions:
    • Build → Archive
    • Post-Actions → TestFlight (Internal Testing)
  3. Start Conditions: Push to main branch
  4. Environment:
    • Xcode Version: Latest Release
    • macOS Version: Latest

Step 6: Fix Bundle Identifier (Important!)

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.

Step 7: Start Build

Push any commit to trigger the build, or click Start Build manually in Xcode Cloud.

Step 8: Add Testers

  1. Go to TestFlight tab in App Store Connect
  2. Under Internal Testing, click + to add testers
  3. Or create an External Testing group for a public link

Troubleshooting Xcode Cloud

"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.


Alternative: MacinCloud

Rent a cloud Mac at macincloud.com (~$20/mo) if Xcode Cloud gives issues.

Features

  • 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

Background Limitations

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.

Troubleshooting

"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.

About

ChargeGuard - Push

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages