Falling Fruit Web Docs

Setup

Web app

To run the app in a browser:

yarn start

Then browse to http://localhost:3000. The app is also available on your local network to test (http-only) on other devices, typically at http://192.168.1.206:3000.

To create a production build (in the build directory):

yarn build

If the build fails due to dependency issues, try starting with a clean install:

rm -rf node_modules
yarn cache clean
yarn

Mobile apps

We use Capacitor to package the web app as Android and iOS apps. Make sure you can build the web app first with yarn build before proceeding. Although most of the mobile app can be tested by opening the web app in a narrow browser window, this is inadequate for testing device-specific functionality like permissions, curved layouts, and onboard functions (camera, compass, and GPS).

Bump app versions

Use capacitor-set-version to set the version (e.g., 0.3.0) and integer build number.

npx capacitor-set-version --version version --build build

Android

android directory · setup · get started

First install the requirements.

Sync the app with any changes to package.json and build output:

npx cap sync android

Run the app on an emulator or device:

npx cap run android  # prompts to select device
# npx cap run android --list
# npx cap run android --device
# npx cap run android --emulator
# npx cap run android --target=<device>

and debug with Chrome at chrome://inspect/#devices.

Alternatively, open as a project in Android Studio:

npx cap open android

Emulators

Follow these instructions to create and manage Android Virtual Devices (AVD) in Android Studio, or use avdmanager from the command line.

Devices

First, enable USB debugging on your device. Then plug the device into your computer, start the adb (Android Debug Bridge) server, and check that the device is listed:

sudo adb start-server
npx cap run android

Release

Build a signed APK to android/app/build/outputs/apk/release/app-release-signed.apk.

npx cap build android

It can be installed to a device manually as follows (uninstalling any unsigned version may be needed):

sudo adb start-server
adb install android/app/build/outputs/apk/release/app-release-signed.apk

iOS

ios directory · setup · get started

First install the requirements.

And prepare Xcode for first use:

# Install Xcode Command Line Tools
xcode-select --install
# Accept Xcode license
sudo xcodebuild -license
# Run Xcode first launch tasks
xcodebuild -runFirstLaunch

Sync the app with any changes to package.json and build output:

npx cap sync ios

Run the app on an emulator or device:

npx cap run ios

Alternatively, open ios/App/App.xcworkspace in Xcode:

npx cap open ios