Formulus App Setup
Build and run the Formulus Android app on a physical device or emulator.
Prerequisites
Before starting, ensure:
- Android device connected via USB (or emulator running)
- USB debugging enabled on device
- ADB recognizes your device
- Server is running (see Synkronus Server Setup)
Step 1: Verify Device Connection
Check that your device is recognized:
adb devices
Expected output:
List of devices attached
YCYNW18209009206 device
If no devices appear:
-
Enable Developer Options on your Android device:
- Go to Settings → About Phone
- Tap "Build Number" 7 times
-
Enable USB Debugging:
- Go to Settings → Developer Options
- Enable "USB Debugging"
-
Accept the USB debugging prompt on your device
-
Try again:
adb devices
Step 2: Navigate to Formulus Directory
cd formulus
Step 3: Start Metro Bundler (Optional but Recommended)
In a separate terminal, start the Metro bundler:
cd formulus
npm start
Keep this terminal open. Metro is the JavaScript bundler for React Native.
Alternative: Metro will start automatically when you run the app, but starting it manually gives you better control.
Step 4: Build and Run Android App
Build and install the app on your connected device:
npm run android
What this does:
- Compiles the Android app
- Builds the APK
- Installs it on your device
- Starts the app
- Connects to Metro bundler
Expected output:
> [email protected] android
> react-native run-android
info Installing the app...
...
Installing APK 'formulus-v1.0-1-debug-20251211.apk' on 'FIG-LX1 - 8.0.0' for :app:debug
Installed on 1 device.
info Connecting to the development server...
info Starting the app on "YCYNW18209009206"...
Step 5: Verify App is Running
The app should automatically open on your device. You should see:
- Formulus splash screen
- Main app interface
- No connection errors (yet - we'll configure the server next)
Building for Different Scenarios
Build Only (Don't Install)
cd formulus/android
./gradlew assembleDebug
The APK will be at:
formulus/android/app/build/outputs/apk/debug/formulus-v1.0-1-debug-YYYYMMDD.apk
Install on Specific Device
adb -s DEVICE_ID install -r path/to/app.apk
Run on Emulator
# Start emulator first
emulator -avd YOUR_AVD_NAME
# Then run
npm run android
Development Workflow
Hot Reload
The app supports Fast Refresh. When you save a file:
- JavaScript changes - Automatically reload
- Native changes - Require app restart
Reload Manually
- Shake device → Select "Reload"
- Or Press
Rtwice in Metro terminal - Or Press
Ctrl+M(Windows/Linux) orCmd+M(Mac) → Select "Reload"
Debug Menu
Access the developer menu:
- Shake device
- Or
adb shell input keyevent 82(Menu key) - Or
Ctrl+M/Cmd+M
Configuring the App
Option A: Scan QR Code (Recommended)
- Generate QR code using Synkronus CLI (see QR Code Login)
- Open Formulus app on your device
- Tap "Scan QR Code" on the welcome/settings screen
- Point camera at the QR code
- Settings auto-populate - Server URL, username, password
- Tap "Connect" to verify and save
Option B: Manual Configuration
- Open Formulus app
- Go to Settings (gear icon or menu)
- Enter Server URL:
http://YOUR_SERVER_IP(e.g.,http://192.168.100.7) - Enter Username: Your username
- Enter Password: Your password
- Tap "Test Connection" to verify
- Tap "Save"
Important: Use your computer's IP address (not localhost) since your Android device is on a different machine.
Finding Your Server IP
# Linux
hostname -I | awk '{print $1}'
# macOS
ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | head -1
Troubleshooting
Issue: "No devices/emulators found"
Solutions:
# Restart ADB
adb kill-server
adb start-server
# Check devices
adb devices
# Verify USB debugging is enabled
Issue: Build fails with lint errors
Solution: For development, you can skip lint:
cd formulus/android
./gradlew assembleDebug -x lintDebug -x lintRelease
Issue: "Metro bundler not found"
Solution: Start Metro manually:
cd formulus
npm start
Then in another terminal:
npm run android
Issue: App crashes on startup
Check:
-
Metro bundler is running
-
Device and computer are on the same network (for Metro)
-
Check device logs:
adb logcat | grep -i "reactnative\|formulus"
Issue: "Unable to resolve module"
Solution:
cd formulus
rm -rf node_modules
npm install
npm start -- --reset-cache
Next Steps
Now that the app is running:
- Configure the server connection (see above)
- Login with your credentials
- Sync app bundle to download forms
- Start collecting data!
For more details, see: