Step-by-Step: Setting Up a Mobile App Development Environment
Getting a mobile development environment running on your machine is a rite of passage, mostly because it usually takes three hours and involves downloading about fifteen gigabytes of software you didn't know existed.
If you're coming from web development, the shift is jarring. In web dev, you save a file and your browser refreshes. In mobile dev, you're compiling native binaries, managing virtual devices that eat your RAM for breakfast, and dealing with two completely different ecosystems that actively try not to get along.
I recently had to set up a fresh MacBook for React Native and Flutter work. Here is the exact path through the setup swamp, minus the dead ends I hit along the way.
1. The Command Line Foundation (Homebrew and Node)
Don't download installers from random websites if you can avoid it. You want a package manager so you can actually update your tools next year without crying.
On macOS, Homebrew is non-negotiable. If you're on Linux, your native package manager handles most of this, and if you're on Windows, you should probably be using WSL2, though that's a whole separate therapy session.
Open your terminal and install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once that finishes, the installer usually prints a couple of "Next steps" lines to add Brew to your PATH. Do not ignore them, or your terminal will pretend it has no idea what brew is the second you close the window.
Next, grab Node.js. Even if you aren't building a React Native app, almost every mobile toolchain relies on Node somewhere under the hood for build scripts or CLI runners.
brew install node
Verify it worked. If node -v spits out a version number, you're ready for the heavy machinery.
2. Android Studio and the SDK Monster
You need Android Studio even if you plan to build iOS apps later. Why? Because you need the Android SDK, the build tools, and the emulator manager. You don't actually have to write code in Android Studio—you can use VS Code or whatever editor you prefer—but you cannot escape installing it.
Download Android Studio from the official site and run the installer. When you get to the setup wizard, choose Custom setup. Do not just click Next on everything. You want to make sure the following components are checked:
- Android SDK
- Android SDK Platform
- Performance (Intel HAXM or AMD equivalent, depending on your chip)
- Android Virtual Device
Once it installs, open the SDK Manager (it's hidden in the settings menus). Go to the SDK Platforms tab and make sure you have at least one recent version installed—Android 14 (API 34) is a safe bet right now.
Then switch to the SDK Tools tab and check these boxes:
- Android SDK Build-Tools
- Android Emulator
- Android SDK Platform-Tools
Here is the gotcha that wasted an hour of my life: your terminal doesn't know where any of this lives by default. You have to wire up your environment variables.
Open your shell configuration file (~/.zshrc or ~/.bash_profile) in your text editor and paste these lines at the bottom:
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
Save the file, then run source ~/.zshrc to apply the changes. If you type adb into your terminal now, it should print a list of commands instead of saying "command not found."
3. Xcode (Mac Only) and iOS Simulator Quirks
If you're on a Mac and want to build for iOS, you have to deal with Xcode. Head over to the Mac App Store and download it.
Fair warning: Xcode is massive—well over 30GB depending on what components it decides to pull down. Start the download, go make a sandwich, watch an episode of something, and come back. It takes a while.
Once Xcode is installed, open it at least once. It needs to prompt you to install additional required components and agree to the license agreement. If you skip this and try to run a build from the command line, Xcode will fail silently or throw an obscure exit code that means nothing.
Next, install the command-line tools:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
You'll also want to install CocoaPods, which is the dependency manager for iOS. Don't use sudo gem install cocoapods if you can avoid it—it messes with system ruby permissions. Use homebrew instead:
brew install cocoapods
To test if your iOS simulator is working without spinning up a whole project yet, you can boot one directly from the terminal:
xcrun simctl boot "iPhone 15"
open -a Simulator
If a shiny virtual iPhone pops up on your screen, you're in business.
4. Creating and Running Your First Test Project
Let's verify everything actually talks to each other. We'll use React Native's CLI for this test because it touches both Android and iOS toolchains.
Create a blank sandbox project:
npx @react-native-community/cli init TestEnvironmentApp
cd TestEnvironmentApp
Now, open two separate terminal tabs.
In tab one, start the Metro bundler:
npm start
In tab two, try launching the Android build:
npm run android
If your Android emulator spins up, builds the app, and displays the default React Native welcome screen without throwing a Gradle build error, your environment is solid.
If it fails with a Gradle error about Java versions, don't panic. Mobile tools are notoriously picky about Java Development Kit (JDK) versions. Android Studio installs its own JDK, but sometimes your system points to an older global version. You can check your Java version with java -version. Most modern mobile frameworks expect JDK 17.
To test iOS (assuming you're on a Mac), run:
cd ios && pod install && cd ..
npm run ios
The simulator should automatically compile the native iOS binary and load the app.
Next Step
Open your terminal right now, type adb devices or spin up an iOS simulator to verify your paths are still working after closing your terminal window. Once you confirm a virtual device boots up cleanly, pick a framework—React Native, Flutter, or native Swift/Kotlin—and run their official "Hello World" tutorial while your environment is still fresh.
Top comments (0)