Minimal iOS habit tracker built with Expo + React Native + TypeScript.
- Node.js (latest LTS recommended)
- npm (bundled with Node)
- Xcode (for iOS Simulator)
npm installStart the Expo dev server:
npx expo startThen choose one:
- Press
ito open the iOS Simulator (requires Xcode installed). - Or open the Expo Developer Tools page and click “Run on iOS simulator”.
- When opening the iOS Simulator, it runs wrong device
- List available devices and pick a valid one:
xcrun simctl list devices- If you want to target a specific simulator:
xcrun simctl boot "<SIMULATOR_NAME>"- Try it:
open -a Simulator- If you have errors related to CocoaPods
- delete ios/Pods and Podfile.lock
rm -r ios/Pods ios/builds
rm ios/Podfile.lock- re-install cocoapods
pnpm ios- Install Expo Go from the iOS App Store (on your iPhone 14).
- In this project folder on your Mac, install dependencies:
npm install- Start the Expo dev server:
npm run start- If your iPhone can’t reach your Mac over the local network, use tunnel mode instead:
npm run start:tunnel- Ensure your iPhone and Mac are on the same Wi‑Fi network (LAN mode only).
- Open Expo Go and scan the QR code shown in the terminal or browser.
This is required for installing the widget on device.
- Prebuild the native iOS project:
npx expo prebuild --platform ios- Open the iOS project in Xcode:
open ios/HabitTracker.xcworkspace- In Xcode, select the HabitTracker target and set Signing & Capabilities:
- Team: your Apple ID (Personal Team is fine)
- Bundle Identifier: unique value (e.g. com.smilinglion.habit-tracker)
- Add the App Groups capability to the app target and include:
group.com.smilinglion.habit-tracker- If you change this id, update it in
ios/HabitTracker/HabitWidgetStorage.swiftandios/widget/widget.swifttoo.
- Use the existing widget target (CalendarWidget lives in
ios/widget). - For the widget target, set:
- Signing to your Apple ID.
- App Groups capability with the same group id.
- Info.plist to
ios/widget/Info.plist. - Entitlements to
ios/widgetExtensionDebug.entitlements.
- Select your iPhone as the run destination and hit Run.
- On first install, you may need: Settings → General → VPN & Device Management → trust the developer profile.
- Long‑press the Home Screen → add the CalendarWidget widget.
- Open the app at least once and mark days so the widget has data.