This guide covers everything needed to get DocPilot running locally for development and testing. It includes extra detail for contributors on Windows and for Android device/emulator testing, where the setup has a few more steps than on macOS/Linux.
- Prerequisites
- Flutter SDK Installation
- Android Studio and SDK Setup
- Project Setup
- API Keys
- Running the App
- Common Issues
| Tool | Minimum version | Notes |
|---|---|---|
| Flutter | 3.27.x (stable) | Check with flutter --version |
| Dart | 3.6.x | Included with Flutter |
| Android Studio | Hedgehog (2023.1) or newer | For Android SDK and AVD |
| Git | Any recent version | |
| VS Code (optional) | Any | With the Flutter + Dart extensions |
- Download the Flutter SDK zip from https://docs.flutter.dev/get-started/install/windows
- Extract it to a path without spaces, e.g.
C:\dev\flutter - Add
C:\dev\flutter\binto yourPATHenvironment variable:- Open System Properties → Environment Variables
- Edit the
Pathvariable under User variables - Add the
binpath and click OK
- Open a new terminal and verify:
flutter --version flutter doctor
Use the official installer or fvm (Flutter Version Manager):
# macOS via Homebrew
brew install --cask flutter
# or via fvm
dart pub global activate fvm
fvm install stable
fvm use stableMake sure to use the stable channel:
flutter channel stable
flutter upgradeEven if you use VS Code as your editor, Android Studio is still needed to manage the Android SDK and create emulators.
- Download and install Android Studio from https://developer.android.com/studio
- On first launch, go through the Setup Wizard — it installs the default Android SDK
- Open SDK Manager (Tools → SDK Manager):
- Under SDK Platforms: install Android 14 (API 34) or newer
- Under SDK Tools: make sure these are checked:
- Android SDK Build-Tools
- Android Emulator
- Android SDK Platform-Tools
- Intel HAXM (Windows only — required for emulator acceleration)
- Accept all SDK licenses by running:
Type
flutter doctor --android-licenses
yat each prompt. - Run
flutter doctoragain — the Android toolchain check should now pass.
For testing DocPilot's microphone features, a physical Android device is strongly recommended because microphone passthrough does not work reliably in most emulators.
To create an emulator anyway:
- Open Device Manager in Android Studio (Tools → Device Manager)
- Click Create Virtual Device
- Choose a Pixel device (e.g. Pixel 6), click Next
- Select a system image (API 34 recommended), download it if needed
- Finish the wizard and start the emulator
Note for emulator users: The
recordpackage used by DocPilot accesses the real microphone. Audio recording will not work inside an emulator unless you enable microphone passthrough in your hypervisor settings. Use a real device for end-to-end testing.
- Enable Developer Options on your phone: go to Settings → About → tap Build Number 7 times
- Enable USB Debugging inside Developer Options
- Connect via USB and accept the debugging prompt on the phone
- Verify Flutter can see the device:
flutter devices
git clone https://github.com/AOSSIE-Org/DocPilot.git
cd DocPilot
flutter pub getDocPilot requires two API keys. Copy the example env file and fill in your keys:
cp .env.example .envOpen .env and replace the placeholders:
GEMINI_API_KEY=your_gemini_api_key_here
DEEPGRAM_API_KEY=your_deepgram_api_key_here
Getting a Deepgram key:
- Sign up at https://console.deepgram.com
- Go to API Keys → Create a new API key
- Copy the key into
.env
Getting a Gemini key:
- Go to https://aistudio.google.com/app/apikey
- Click Create API key
- Copy the key into
.env
Important: Never commit your
.envfile. It is listed in.gitignore. Only.env.example(with placeholder values) is tracked by git.
# List available devices
flutter devices
# Run on a connected Android device
flutter run
# Run on a specific device by ID
flutter run -d <device-id>
# Run in release mode (closer to production performance)
flutter run --releaseTo run the tests:
flutter testTo check for lint issues:
flutter analyze- Open Android Studio → Tools → SDK Manager and note the Android SDK Location path
- Run:
flutter config --android-sdk "C:\path\to\your\sdk"
- Make sure Platform-Tools is installed via SDK Manager
- Add
%LOCALAPPDATA%\Android\Sdk\platform-toolsto yourPATH(Windows) - Try unplugging and replugging the USB cable, and re-accepting the debug prompt
flutter clean
flutter pub get
flutter run- Make sure
.envexists at the project root (not insidelib/) - Make sure the values are real keys, not the placeholder text from
.env.example - The app will show an inline banner on the main screen if it detects missing or placeholder keys
set FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
set PUB_HOSTED_URL=https://pub.flutter-io.cn
flutter pub getcd android
./gradlew clean # macOS/Linux
gradlew.bat clean # Windows
cd ..
flutter run