4.1 KiB
4.1 KiB
Build Instructions - Pottery Diary
Quick Start (Development)
# Navigate to project
cd pottery-diary
# Install dependencies (if not already done)
npm install
# Start Expo development server
npm start
# In another terminal, run on platform:
npm run ios # iOS Simulator (Mac only)
npm run android # Android Emulator
Testing
# Run all unit tests
npm test
# Watch mode for development
npm run test:watch
# Expected output: All tests passing for:
# - Temperature conversions
# - Cone converter
# - Duration formatting
Production Builds
Prerequisites
- Install EAS CLI:
npm install -g eas-cli - Create Expo account: https://expo.dev/signup
- Login:
eas login
Configure Project
# First time only
eas build:configure
# This creates/updates eas.json and app.json
Build Commands
iOS
# Build for iOS
eas build --platform ios --profile production
# Build for iOS Simulator (testing)
eas build --platform ios --profile preview
Android
# Build APK for Android
eas build --platform android --profile production
# Build for testing
eas build --platform android --profile preview
Both Platforms
eas build --platform all --profile production
Build Profiles (eas.json)
- development: Development client with debugging
- preview: Internal testing builds (APK for Android, Simulator for iOS)
- production: Store-ready builds
Troubleshooting
Common Issues
1. SQLite not found
# Reinstall expo-sqlite
npx expo install expo-sqlite
2. Navigation errors
# Clear cache and restart
npx expo start --clear
3. TypeScript errors
# Check TypeScript compilation
npx tsc --noEmit
4. Test failures
# Clear Jest cache
npm test -- --clearCache
npm test
Platform-Specific
iOS
- Xcode required: Mac with Xcode 14+ for local builds
- Simulator: Install via Xcode → Preferences → Components
- Certificates: EAS handles signing for cloud builds
Android
- Android Studio: Install for local emulator
- SDK: API Level 26+ (Android 8.0+)
- Emulator: Create AVD with Google Play Store
Environment Setup
Required
- Node.js 18+
- npm 9+
- Expo CLI (installed via npx)
Optional (for local builds)
- Xcode 14+ (iOS, Mac only)
- Android Studio 2022+ (Android)
- EAS CLI (cloud builds)
Database Management
Reset Database (Development)
# Uninstall app to clear SQLite database
# Or delete app data via device settings
# Database auto-migrates on next launch
View Database
# Use a SQLite browser to inspect:
# iOS: ~/Library/Developer/CoreSimulator/Devices/[DEVICE_ID]/data/Containers/Data/Application/[APP_ID]/Library/Application Support/SQLite/pottery_diary.db
# Android: Use adb or Device File Explorer in Android Studio
Performance Optimization
App Size
- Current: ~20-30 MB (target < 30 MB)
- Photos are compressed on import
- No large assets bundled
Speed
- Cold start: <1s (target)
- List scrolling: 60 FPS
- Database queries: <50ms for most operations
Release Checklist
- All tests passing (
npm test) - TypeScript compiles (
npx tsc --noEmit) - No console errors in dev mode
- Test on both iOS and Android
- Accessibility check (VoiceOver/TalkBack)
- Update version in app.json
- Update CHANGELOG.md
- Build with EAS
- Test build on physical devices
- Submit to App Store / Play Store
Continuous Integration (Future)
Recommended setup:
- GitHub Actions for automated testing
- EAS Build on push to main
- Detox for E2E testing
Example .github/workflows/test.yml:
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm test
Support
- Issues: https://github.com/yourusername/pottery-diary/issues
- Expo Docs: https://docs.expo.dev/
- React Native Docs: https://reactnative.dev/
Last Updated: 2025-01-15