How to Set Up GitHub Copilot in Android Studio (Step by Step)
Android Studio is Google's IDE for Android apps. It is built on IntelliJ, so GitHub Copilot works there through the same JetBrains plugin. Android Studio also has Google's own Gemini assistant built in.
In short: Settings → Plugins → Marketplace → GitHub Copilot (publisher GitHub) → Restart → Tools → GitHub Copilot → Login to GitHub → device code.
Why Copilot in Android Studio
Android apps need a lot of repeated code: layouts, view models, adapters, tests. Copilot writes that fast in Kotlin. If your team already uses Copilot in other IDEs, the same account and rules work here.
What you need
- Android Studio: keep it updated. The Marketplace only offers Copilot builds that fit your version.
- GitHub account with Copilot: Copilot Free or a paid plan.
- GitHub Copilot plugin: the same JetBrains plugin as IntelliJ. There is no separate Android build.
- Gemini in Android Studio: Google's built-in assistant. It is a different product. Its “Agent Mode” is not Copilot's agent mode.
How setup flows
Install steps
- Open Android Studio → Settings (Mac: Android Studio → Settings) → Plugins.
- Open Marketplace, search GitHub Copilot. Check the publisher is GitHub. Click Install.
- Click Restart IDE.
- Open Tools → GitHub Copilot → Login to GitHub.
- Click Copy and Open, paste the device code in the browser, click Continue.
- Click Authorize GitHub Copilot Plugin, then OK in Android Studio.
Settings
- Completions: Copilot icon in the status bar → pause or turn off per language.
- Chat: the GitHub Copilot Chat tool window. Pick Ask or Agent mode, and a model.
- Two assistants? If Gemini and Copilot both show inline suggestions, turn off inline completions in one of them to avoid clashes.
- Plugin errors after an Android Studio update: update the plugin; a brand-new Studio build can arrive before the plugin supports it.
Configuration
- Add
.github/copilot-instructions.md: “Kotlin, Jetpack Compose, ViewModel + StateFlow, JUnit tests, no hard-coded API keys.” - Keep API keys in
local.properties(not committed) or a secrets plugin, never in source.
# Rules for Copilot (Android) - Kotlin only, Jetpack Compose for UI - ViewModel + StateFlow, no logic in Composables - Unit tests with JUnit for every ViewModel - Never hard-code API keys
First task (5 minutes)
- Open a Kotlin file. Type
// EMI for principal, annual rate %, monthsand startfun emi(. Press Tab to accept. - In Copilot Chat ask: “Write unit tests for emi, including zero interest.”
- Run the tests with the green arrow. See the tested EMI example in Code in Kotlin using AI.
Quick quiz
1. Is there a separate Copilot plugin for Android Studio?
No. It uses the same JetBrains GitHub Copilot plugin.
2. How do you log in after installing?
Tools → GitHub Copilot → Login to GitHub, then the device code.
3. Is Gemini's Agent Mode the same as Copilot's agent mode?
No. They are different products from different companies.
4. Where should Android API keys live?
In local.properties (not committed) or a secrets setup, never in source code.
Save tokens and money
Use inline completion for Compose boilerplate; it is the cheapest. Ask chat about one file at a time. Do not paste whole Gradle build logs, only the error lines.