# AGENTS.md (iOS)

This file configures Codex behavior for `ios/` (`/Users/craigvandergalien/Documents/GitHub/lichun/ios`).

## Scope

- Applies only to files under `ios/`.
- Inherits root guidance from `../AGENTS.md` unless overridden here.

## Project Entry Points

- Xcode project: `lichunWebsocket.xcodeproj`
- Main app scheme: `BaoLife`
- Unit tests: `lichunWebsocketTests`
- UI tests: `lichunWebsocketUITests`
- API contract reference: `BACKEND.md`

## Build Commands

```bash
cd /Users/craigvandergalien/Documents/GitHub/lichun/ios

# Open project in Xcode
open lichunWebsocket.xcodeproj

# CLI debug build
xcodebuild -project lichunWebsocket.xcodeproj -scheme BaoLife -configuration Debug build

# Simulator build
xcodebuild -project lichunWebsocket.xcodeproj -scheme BaoLife -sdk iphonesimulator -configuration Debug
```

## Test Commands

```bash
cd /Users/craigvandergalien/Documents/GitHub/lichun/ios

# All tests
xcodebuild test -project lichunWebsocket.xcodeproj -scheme BaoLife -destination 'platform=iOS Simulator,name=iPhone 15'

# Unit tests only
xcodebuild test -project lichunWebsocket.xcodeproj -scheme BaoLife -destination 'platform=iOS Simulator,name=iPhone 15' -only-testing:lichunWebsocketTests

# UI tests only
xcodebuild test -project lichunWebsocket.xcodeproj -scheme BaoLife -destination 'platform=iOS Simulator,name=iPhone 15' -only-testing:lichunWebsocketUITests
```

If `iPhone 15` is unavailable locally:

```bash
xcrun simctl list devices available
```

Then replace destination with an installed simulator name.

## Backend Connectivity Notes

- Production WebSocket endpoint in code: `wss://lichun.app/wss/`.
- Development endpoint in code: `ws://localhost:8001`.
- Key files:
  - `lichunWebsocket/WebSocketService.swift`
  - `lichunWebsocket/Shared/Utilities/Constants.swift`

When modifying message formats, keep iOS parsing aligned with backend contracts in `BACKEND.md`.

## Deep Link Testing Shortcuts

```bash
xcrun simctl openurl booted "baolife://home"
xcrun simctl openurl booted "baolife://activities"
xcrun simctl openurl booted "baolife://social/dating"
xcrun simctl openurl booted "baolife://store"
xcrun simctl openurl booted "baolife://skip-onboarding"
```

See `DEEP_LINKING.md` for the complete route list.
