Back to Dashboard

    Build Your Native App

    Follow this guide to publish BuildTrac to the App Store and Google Play. Once published, your subscribers can download the app and enjoy background GPS tracking.

    Prerequisites

    • Required
      Node.js and npm installed on your computer
    • For iOS
      Mac with Xcode installed (download free from Mac App Store)
    • For Android
      Android Studio installed (download from developer.android.com)
    • Required
      GitHub account for exporting your project

    ⚠️ Critical: Production vs Development Config

    This determines whether your app shows YOUR login page or Lovable's login page

    ✅ For App Store Distribution

    The default capacitor.config.ts is ready for production.

    • App loads from bundled files
    • Shows BuildTrac login page
    • Works offline
    • Independent of Lovable servers

    🔧 For Development Testing

    Use capacitor.config.dev.ts for hot-reload.

    • Copy dev config to capacitor.config.ts
    • Requires Lovable login first
    • See live changes instantly
    • Switch back before store submission!

    If you're seeing Lovable's login instead of BuildTrac's:

    1. Open capacitor.config.ts in your cloned project
    2. Make sure there's NO server: { url: ... } block
    3. Run: npm run build && npx cap sync
    4. Rebuild and run the app

    Step-by-Step Build Process

    1

    Export to GitHub

    Get your code on GitHub for local development

    In Lovable, click the "Export to GitHub" button in the top-right menu. This creates a repository with all your code.

    💡 After exporting, you'll get a GitHub URL like: github.com/yourusername/buildtrac
    2

    Clone and Install

    Download the code and install dependencies

    git clone https://github.com/yourusername/buildtrac.git
    cd buildtrac
    npm install

    Replace yourusername with your actual GitHub username.

    3

    Add Native Platforms

    Set up iOS and/or Android projects

    npx cap add ios
    npx cap add android
    4

    Build and Sync

    Compile your web app and sync to native projects

    npm run build
    npx cap sync

    Run these commands every time you want to update the native app with changes from Lovable.

    5

    Configure Permissions

    Add required location permissions for background GPS

    How to find and edit Info.plist:

    1. In Finder, navigate to your project folder
    2. Open the ios → App → App folder
    3. Right-click on Info.plist and select "Open With" → "TextEdit" (or any text editor)
    4. Find the section that starts with <dict> near the top
    5. Paste the code below before the closing </dict> tag
    6. Save the file (Cmd + S)

    Full file path: ios/App/App/Info.plist

    Add these lines inside the <dict> section:

    <key>NSLocationWhenInUseUsageDescription</key>
    <string>BuildTrac needs your location to track mileage for your business trips.</string>
    
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>BuildTrac needs background location access to continue tracking mileage when you switch apps or lock your phone.</string>
    
    <key>UIBackgroundModes</key>
    <array>
      <string>location</string>
    </array>

    💡 Tip: You can also edit Info.plist directly in Xcode. Open the ios/App folder in Xcode, select Info.plist in the left sidebar, then click the "+" button to add new keys.

    6

    Open in IDE

    Launch the native project in Xcode or Android Studio

    iOS

    npx cap open ios

    Opens in Xcode

    Android

    npx cap open android

    Opens in Android Studio

    App Store Submission

    Apple App Store

    $99/year developer account

    1. Enroll in Apple Developer Program
    2. Create App ID in Certificates portal
    3. Archive and upload from Xcode
    4. Submit for review in App Store Connect
    Apple Distribution Guide

    Google Play Store

    $25 one-time fee

    1. Create Google Play Developer account
    2. Generate signed APK/AAB in Android Studio
    3. Create app listing in Play Console
    4. Upload bundle and submit for review
    Google Distribution Guide

    Updating Your App

    When you make changes in Lovable and want to update the native app:

    cd buildtrac
    git pull origin main
    npm install
    npm run build
    npx cap sync
    npx cap open ios  # or android

    Then archive and submit the new version through Xcode or Android Studio.

    Need help? Check out the Capacitor documentation for more details.