반응형
To run an Android emulator from the command line on Windows, you'll need to have Android Studio and the Android SDK installed. Here’s a step-by-step guide:
Step 1: Ensure Android SDK is Installed
- Install Android Studio if it's not already installed. This will install the Android SDK as well.
- Set up the Android SDK Path:
- Open Android Studio.
- Go to
File > Settings > Appearance & Behavior > System Settings > Android SDK
. - Note the path of the Android SDK (e.g.,
C:\Users\<YourUsername>\AppData\Local\Android\Sdk
).
Step 2: Add SDK Tools to System PATH
- Add the SDK Tools to the PATH:
- Press
Windows + R
, typesysdm.cpl
, and hit Enter. - Go to the
Advanced
tab and click onEnvironment Variables
. - In the
System variables
section, find thePath
variable and clickEdit
. - Click
New
and add the following paths:C:\Users\<YourUsername>\AppData\Local\Android\Sdk\platform-tools C:\Users\<YourUsername>\AppData\Local\Android\Sdk\emulator
- Replace
<YourUsername>
with your actual username.
- Press
Step 3: List Available Emulators
Open Command Prompt and run the following command to list all available AVDs (Android Virtual Devices):
emulator -list-avds
This will display the names of all the emulators you have configured.
Step 4: Start an Emulator
To start an emulator, use the following command:
emulator -avd <emulator_name>
Replace <emulator_name>
with the name of the AVD you want to start, as listed by the emulator -list-avds
command.
Example
- List available emulators:Output might be:
Pixel_3a_API_30 Nexus_5X_API_29
emulator -list-avds
- Start an emulator:
emulator -avd Pixel_3a_API_30
This command will launch the Pixel_3a_API_30
emulator.
Troubleshooting
- If you get a "command not found" error, ensure that the paths to
platform-tools
andemulator
are correctly added to your systemPATH
. - Make sure the Android emulator is properly configured in Android Studio.
Summary
- Install Android Studio and set up the Android SDK.
- Add SDK tools to the system PATH.
- List available AVDs with
emulator -list-avds
. - Start an emulator with
emulator -avd <emulator_name>
.
반응형
'[====== Development ======] > Android' 카테고리의 다른 글
안드로이드 다국적(?) 앱 만들어 보기 (feat 카카오 번역 API, python 활용) (0) | 2023.09.26 |
---|---|
[Android] Webview smooth scroll (0) | 2022.06.20 |
화면을 아래로 Drag하여 화면 새로고침하기 (SwipeRefreshLayout) (0) | 2022.06.06 |
Android 무선 디버깅 설정 (0) | 2022.05.15 |
리스트에서 아이템 클릭 후 Activity 전환 애니메이션 (0) | 2022.05.10 |