Setting Up Android Studio & the Emulator
S7 Inf A3 — Java for Graphical and Mobile Programming
Stéphane Derrode — Centrale Lyon
Do this before your first Android lab session (TD6). The full setup takes 30–60 minutes depending on your internet connection (the SDK download is large). If you encounter problems, come 10 minutes early to the session.
What you will install
| Tool | Purpose | Size |
|---|---|---|
| Android Studio | IDE + Android SDK | ~1 GB |
| Android SDK API 33 | Android 13 platform | ~500 MB |
| Pixel 6a system image (x86_64) | Emulator image | ~1.5 GB |
Total disk space needed: approximately 8 GB (Android Studio + SDK + emulator).
Step 1 — Download Android Studio
- Go to https://developer.android.com/studio
- Click Download Android Studio — the site detects your OS automatically
- Run the installer:
- Windows: run the
.exe, accept all defaults, install toC:\Program Files\Android\ - macOS: open the
.dmg, drag Android Studio to Applications - Linux: unzip the archive, run
bin/studio.sh
On first launch, Android Studio runs a Setup Wizard — follow the steps below.
Step 2 — Setup Wizard
When Android Studio launches for the first time:
- Click Next on the welcome screen
- Choose Standard installation type → Next
- Choose your UI theme (Light or Dark) → Next
- Android Studio downloads the SDK — this takes several minutes
- Click Finish when the download is complete
Step 3 — Install API 33 (Android 13)
If the SDK Manager didn't install API 33 automatically:
- Open Android Studio → Tools → SDK Manager
- In the SDK Platforms tab, check Android 13.0 (API 33)
- In the SDK Tools tab, verify these are checked:
- Android SDK Build-Tools 33
- Android Emulator
- Android SDK Platform-Tools
- Click Apply → OK → wait for download
Step 4 — Create the Pixel 6a Emulator
- Open Tools → Device Manager (or AVD Manager in older versions)
- Click Create device (or the + button)
- Under Phone category, select Pixel 6a → Next
- Select system image:
- Tab: x86 Images
- Row: API Level 33, ABI x86_64, Target: Android 13.0 (Google APIs)
- If not downloaded yet: click the Download link next to it → wait
- Click Next → Finish
Configure for better performance (optional)
Before clicking Finish, click Show Advanced Settings:
- RAM: 2048 MB minimum (4096 if your machine has ≥ 16 GB RAM)
- VM heap: 512 MB
- Internal storage: 2048 MB
Step 5 — Start the Emulator
- In Device Manager, click the ▶ Play button next to Pixel 6a API 33
- Wait for the emulator to boot (first boot takes 2–3 minutes)
- The Android home screen should appear
Useful emulator shortcuts:
| Action | Shortcut |
|---|---|
| Rotate landscape | Ctrl + Left/Right (Windows/Linux) or Cmd + Left/Right (macOS) |
| Home button | Ctrl + H / Cmd + H |
| Back button | Escape |
| Volume up/down | Ctrl + Up/Down |
| Power button | Ctrl + P |
Step 6 — Verify with Hello World
- In Android Studio: File → New → New Project
- Template: Empty Views Activity → Next
- Name:
HelloAndroid, Language: Java, Min SDK: API 26 → Finish - Wait for Gradle sync
- Click ▶ Run (Shift+F10) — select the Pixel 6a emulator
- The app should launch showing "Hello World!"
If you see "Hello World!" on the emulator, your setup is complete.
Troubleshooting
Emulator is very slow
→ Enable hardware acceleration. On Windows: install Intel HAXM via SDK Manager → SDK Tools → Intel x86 Emulator Accelerator (HAXM installer). On Linux: install KVM (sudo apt install qemu-kvm).
"HAXM is not installed" on macOS with Apple Silicon
→ Apple Silicon (M1/M2) cannot use x86 HAXM. In Step 4, choose ARM Images tab instead of x86 Images, and select arm64-v8a. Performance will be better on Apple Silicon with ARM images anyway.
Gradle sync failed: "SDK location not found"
→ Go to File → Project Structure → SDK Location and point it to your Android SDK folder (usually C:\Users\YourName\AppData\Local\Android\Sdk on Windows or ~/Library/Android/sdk on macOS).
"Cannot resolve symbol R"
→ Your XML file has a syntax error. Fix the XML then Build → Rebuild Project (Ctrl+F9).
App installs but immediately crashes
→ Open Logcat (bottom panel), filter by your app's package name, read the red error lines from top to bottom. The first red line usually pinpoints the problem.
No emulator appears in the run target
→ Make sure the emulator is running (you should see the Android home screen). If not, start it from Device Manager first.
Android Studio Shortcuts
| Action | Windows/Linux | macOS |
|---|---|---|
| Run app | Shift+F10 |
Ctrl+R |
| Debug app | Shift+F9 |
Ctrl+D |
| Rebuild project | Ctrl+F9 |
Cmd+F9 |
| Auto-import | Alt+Enter |
Option+Enter |
| Format code | Ctrl+Alt+L |
Cmd+Option+L |
| Go to definition | Ctrl+B |
Cmd+B |
| Rename | Shift+F6 |
Shift+F6 |
| Open Logcat | Alt+6 |
Cmd+6 |
| Open file | Ctrl+Shift+N |
Cmd+Shift+O |
| Search everywhere | Shift+Shift |
Shift+Shift |