Devices
Android Studio 2: The New UI
Course 2 ยท Chapter 6 ยท Device Manager and Running Devices
An app has to run somewhere: on an emulator (a virtual phone on your computer) or on a physical device. The Classic UI had an "AVD Manager" for the first and a plain device drop-down for the second. Rabbit 2 has two tool windows for the job: Device Manager (which devices exist, and what you can do with them) and Running Devices (the device's screen, shown inside the IDE). This chapter explains both, plus Device Explorer and pairing a phone over Wi-Fi.
Where Things Are
| Tool | How to open it | What it is for |
|---|---|---|
| Device Manager | Icon on the right-hand tool-window bar; Tools > Device Manager; View > Tool Windows > Device Manager. On the Welcome screen: More Actions > Virtual Device Manager. | List, create, start and stop virtual devices; see connected physical devices. |
| Running Devices | Icon on the right-hand bar; View > Tool Windows > Running Devices only (it is not under Tools). It opens by itself when an emulator or a mirrored phone starts. | Show and control a running device's screen inside the IDE. |
| Device Explorer | View > Tool Windows > Device Explorer (still in the list on Rabbit 2). | Browse a device's file system (general knowledge). |
Creating a Virtual Device
(general knowledge: I did not re-check these steps on Rabbit 2) In Device Manager, use the + (create device) button, choose a hardware profile (a phone size such as the Medium Phone the toolbar shows), choose a system image (an Android version, which is downloaded the first time you pick it), then name it and finish. Your installation offers API 37.0 images. Two habits help:
- Match the image to what you are testing. A recent API level shows current behaviour; an older one near your project's
minSdk(24 in a generated project, Chapter 3) shows the oldest phones you support. - Prefer an image that matches your computer's processor type, since a mismatched one is far slower (general knowledge).
The toolbar's device selector (it showed "Medium Phone API 37.0" in the project checked) chooses which device Run installs the app on.
Running Devices: the Screen in the IDE
Start an emulator from Device Manager and the Running Devices window opens with its screen, so the phone does not float in a separate window. You can show a physical phone the same way: (docs) device mirroring is available whenever a device with USB or wireless debugging turned on is connected, and you can start and stop it from Running Devices or from Device Manager. The mirroring settings are under Settings > Tools > Device Mirroring. The docs also warn that Android Studio can start mirroring automatically for any connected, paired device, so turn that off there if you do not want your phone's screen appearing whenever you plug it in.
Pairing a Phone over Wi-Fi
(docs) Wireless debugging needs a phone on Android 11 or higher, on the same network as your computer. The outline:
- On the phone, turn on Developer options, then Wireless debugging.
- In Android Studio open the Pair Devices Using Wi-Fi dialog from the run-configuration menu in the toolbar, or pair from Device Manager.
- Pair with the QR code or a six-digit pairing code shown on the phone.
The docs' blog describes a newer "ADB Wi-Fi 2.0" flow with a pair-over-Wi-Fi icon in Device Manager, but says it needs Android 17 and Android Studio Quail 3 or later, so I have not assumed it applies to your install. If the phone does not appear, the old fallback is USB: connect with a cable, accept the debugging prompt on the phone, and it appears in the device selector (general knowledge).
Try It Yourself
Open Device Manager three ways (right-hand bar, Tools menu, View > Tool Windows) and Running Devices once. Say which entries are missing from the Tools menu.
๐ View solutionCreate a virtual device with a system image of your choice, start it, and run the scratch project on it. Report which window opened when the emulator started and what the toolbar's device selector shows.
๐ View solutionIf you own an Android phone, enable debugging, connect it by USB or Wi-Fi, and mirror it in Running Devices. Then find the Device Mirroring settings and decide whether you want mirroring to start automatically. Without a phone, find that settings page and describe what it offers.
๐ View solutionChecked in the docs (one web search, summaries only): mirroring availability and start/stop, Settings > Tools > Device Mirroring, automatic mirroring, Android 11 for wireless debugging, the QR and six-digit pairing options, the Pair Devices Using Wi-Fi dialog, and the ADB Wi-Fi 2.0 caveat.
Not verified: the create-device steps; what Device Manager and Running Devices look like with a device; what Device Explorer shows on Rabbit 2; the exercises (not run by me). A screenshot of Running Devices with a mirrored phone or emulator would verify this chapter.
Sources: Run apps on a hardware device (developer.android.com), ADB Wi-Fi 2.0 (Android Developers' Blog).