This guide provides step-by-step instructions for setting up a Flutter development environment on macOS without using Android Studio.
- macOS with Homebrew installed
- Xcode installed from the App Store
- Terminal access
brew install flutterVerify the installation:
flutter doctorbrew install android-commandlinetools# Install platform tools, Android SDK, and build tools
sdkmanager --install "platform-tools" "platforms;android-34" "build-tools;34.0.0"
# Verify installed components
sdkmanager --list_installedCreate a symlink for Android SDK:
ln -s /opt/homebrew/share/android-commandlinetools ~/Library/Android/sdkSet up environment variables in your shell profile (~/.zshrc or ~/.bash_profile):
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"flutter doctor --android-licensesbrew install openjdk@17
flutter config --jdk-dir /opt/homebrew/opt/openjdk@17Verify Java installation:
flutter doctor -v | grep -A5 "Java"# Switch to Xcode developer tools
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
# Run Xcode first launch setup
sudo xcodebuild -runFirstLaunchbrew install cocoapods
pod setup
pod --versionNavigate to the Vapi Flutter SDK directory:
# Install dependencies for the main project
flutter pub get
# Install dependencies for the example project
cd example
flutter pub getflutter devices
flutter emulatorsflutter run -d macos
# or build
flutter build macos# List available simulators
xcrun simctl list devices available
# Open iOS Simulator
open -a Simulator
# Run on specific device
flutter run -d "iPhone 16 Plus"# Download Android system image
sdkmanager --install "platforms;android-36" "system-images;android-36;google_apis_playstore;arm64-v8a"
# Create emulator
avdmanager create avd -n android36_emulator -k "system-images;android-36;google_apis_playstore;arm64-v8a" -d pixel_7_pro
# List available emulators
avdmanager list avd# Launch emulator
flutter emulators --launch android36_emulator
# Run app on emulator
flutter devices # Note the device ID (e.g., emulator-5554)
flutter run -d emulator-5554
# Check connected devices
adb devicesflutter run -d chromecd example
flutter clean
flutter build apk --debugmacOS Gatekeeper Fix: If the build fails due to macOS Gatekeeper blocking the gen_snapshot binary:
find /opt/homebrew/Caskroom/flutter/ -name gen_snapshot -exec sudo xattr -rd com.apple.quarantine {} \;# Switch to a pull request branch
gh pr checkout <PR_NUMBER># Delete an emulator
avdmanager delete avd -n <emulator_name>
# Uninstall system images
sdkmanager --uninstall "system-images;android-34;google_apis_playstore;arm64-v8a"- Flutter Doctor Issues: Run
flutter doctor -vfor detailed diagnostics - Android License Issues: Re-run
flutter doctor --android-licensesand accept all - Xcode Issues: Ensure Xcode is properly installed and command line tools are configured
- Build Failures: Try
flutter cleanbefore rebuilding
After setup is complete, you can:
- Run the example app on various platforms
- Modify the code and test hot reload
- Build release versions for distribution
For more information, refer to the Flutter documentation.