受欢迎的博客标签

Android|Android Studio| Install and Launch Android Emulator standnone without Android Studio installed on Windows 10 (Command-Line-Tools)

Published

Command line tools only

If you do not need Android Studio, you can use Command line tools only.you can download the basic Android command line tools(These tools are included in Android Studio.).

You can use the included sdkmanager to download other SDK packages.

 

 

 

Table of Content

Download and Install Android command line tool -->get sdkmanager included Command-Line-Tools

Use sdkmanager -> Use the  sdkmanager to download other SDK packages

sdkmanager是一个命令行工具,用来下载其他SDK工具

 

Download and install JDK

Set JAVA_HOME variable.

 

Download and install Intel Hardware Accelerated Execution Manager

Download a device system image->for example:Run Android Oreo on your test device.

Step 1:Download Command-Line-Tools

Go to Downloads page , https://developer.android.com/studio/#downloads ,scroll down to "Command line tools only" section and download the archive with tools.

https://developer.android.google.cn/studio?hl=tr#cmdline-tools

you will get sdkmanager included Command-Line-Tools

 

D:\cmdline-tools\bin
apkanalyzer.bat   
lint.bat          
retrace.bat       
sdkmanager.bat
avdmanager.bat    
profgen.bat      
screenshot2.bat

 

Step 2:Use the  sdkmanager to download other SDK packages

Android SDK Manager(管理器):用来下载 SDK 工具、SDK平台和开发应用中需要用到的其他组件

Android SDK 包含一个 Android 设备模拟器,是一台在计算机上运行的虚拟设备

 

Step 3:使用 emulator 命令启动模拟器

 

Android 虚拟设备

Android 虚拟设备 (AVD)

Android 模拟器的每个实例都通过 Android 虚拟设备 (AVD) 来指定模拟设备的 .

为了有效地测试您的应用,应创建一个 AVD,让其模拟运行应用.

每个 AVD 都可以作为一台独立的设备工作,并拥有专属的用户数据存储空间、SD 卡等等。默认情况下,模拟器将用户数据、SD 卡数据和缓存存储在特定于该 AVD 的目录中。当您启动模拟器时,它会从该 AVD 目录加载用户数据和 SD 卡数据。

AVD 系统目录

AVD 系统目录系统目录包含模拟器用于模拟操作系统的 Android 系统映像。它包括 API 级别、CPU 架构和 Android 变体。

AVD 系统目录默认位置如下:

Windows Vista - C:\Users\user\Library\Android\sdk\system-images\android-apiLevel\variant\arch\

系统映像

运行 Android 模拟器需要系统映像。每个版本的平台均包含受支持的系统映像。您也可以之后在从 AVD 管理器中创建 Android 虚拟设备 (AVD) 时下载系统映像。根据开发计算机的处理器选择 Intel 。

 

HAXM-(Intel Hardware Accelerated Execution Manager)

https://github.com/intel/haxm/releases

Detailed instructions for building and testing HAXM Manual for Windows https://github.com/intel/haxm/blob/master/docs/manual-windows.md

Install Intel HAXM follow the instructions: https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows

HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor), widely used as an accelerator for Android Emulator and QEMU. It has always supported running on Windows and macOS, and has been ported to other host operating systems as well, such as Linux and NetBSD.

HAXM runs as a kernel-mode driver on the host operating system, and provides a KVM-like interface to user space, thereby enabling applications like QEMU to utilize the hardware virtualization capabilities built into modern Intel CPUs, namely Intel Virtualization Technology.

在 Intel CPU 的主机上启用 HAXM,是为了加速AVD模拟器的运行速度
在 Intel CPU 的主机上,为了加速AVD模拟器的运行速度,需要启用 HAXM 。如果在没有启用 HAXM 时就运行程序,调用AVD模拟器时会报如下错误:

emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!

出现此警告的原因是AVD模拟器调用X86架构的安卓虚拟机需要使用到Intel HAXM 引擎,而本机尚未进行安装导致。
此时,应该:

Step 1:先进入 BIOS 启用 Virtualization Technology 选项。

Step 2:然后从 https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager/ 下载,

Other:也可以直接在 Android Studio 的 SDK 中下载,再安装即可。

Windows 10  intel cpu 

 

Useful links

 

win10系统怎么启用bios虚拟化设置

 

启用 bios 虚拟化