This guide walks you step by step through exercising the new unit tests, running on simulators and real devices, and shipping the macOS and iOS builds. It is written for newcomers—just follow each numbered step in order.
- Open the BetterTimer Xcode project on your Mac.
- In the navigator, make sure the Tests group contains
TimerEngineTests.swiftandTimerStoreTests.swift. - Select the BetterTimer scheme and choose a simulator destination (e.g., iPhone 15). The tests run fine on any simulator because they don’t require device-only features.
- Press ⌘U (or choose Product → Test) to run the suite.
- Confirm the following behaviors:
- Countdown:
testCountdownCompletesstarts a 2-second timer and waits for it to report a completed state. - Pause/Resume:
testPauseAndResumepauses after the first tick, verifies the remaining time is frozen, then resumes and finishes. - Persistence:
testPersistenceRoundTripsaves sample timers into a temporaryUserDefaultssuite and reloads the exact same values.
- Countdown:
Follow these per-platform steps so you cover every supported device type.
- In Xcode’s scheme picker, select the macOS target (e.g., BetterTimer-macOS).
- Choose My Mac as the run destination.
- Press ⌘R to launch. Start a timer, pause it, and confirm the countdown updates in the UI.
- Switch the scheme to the iOS app target.
- Pick a simulator running iOS 16.1 or later (e.g., iPhone 14 – iOS 16.4).
- Press ⌘R, create a timer, and test pause/resume to ensure the engine matches the unit tests.
- Select the watchOS target (e.g., BetterTimer-watchOS).
- Pick a paired watch simulator.
- Press ⌘R to deploy. Verify you can start and pause timers from the watch UI.
- Connect a physical iPhone running iOS 16.1 or later.
- In Signing & Capabilities for the iOS target, ensure App Intents and Live Activities are enabled and your team is selected.
- Choose your device as the run destination and press ⌘R.
- Start a timer, then lock the phone—confirm the Live Activity updates the countdown.
- Open Shortcuts on the device, add a new shortcut, and search for your BetterTimer intents. Run it to ensure Siri/Shortcuts can start or pause a timer.
- Open Product → Archive with the iOS scheme selected.
- When the archive finishes, click Distribute App → App Store Connect → Upload.
- In App Store Connect, add internal testers, then promote to external testers after Apple’s beta review passes.
- Share the TestFlight invite link with your testers.
Choose the distribution path that fits your needs:
A. Notarized DMG for direct download
- Archive the macOS scheme (Product → Archive).
- In the Organizer, select the archive, click Distribute App → Developer ID.
- Follow the prompts to sign and upload for notarization.
- After notarization succeeds, staple the ticket (
xcrun stapler staple <YourApp>.app) and wrap the app in a DMG for distribution.
B. Mac App Store submission
- In Signing & Capabilities, ensure the macOS target uses your Mac App Store provisioning profile.
- Archive the macOS scheme.
- Choose Distribute App → App Store Connect → Upload.
- In App Store Connect, fill out pricing, screenshots, and submit for review.
You now have a step-by-step path to test the timer logic, validate it on simulators and real hardware, and deliver the app through TestFlight or a notarized macOS build.