@if (isDeviceReady()) {
phone_android
{{ activeDevice()?.model || activeDevice()?.serial }}
@if (activeDevice()?.is_emulator) {
虚拟设备
·
}
{{ activeDevice()?.serial }}
@if (activeDevice()?.screen_resolution) {
·
{{ activeDevice()?.screen_resolution }}
}
@if (activeDevice()?.android_version) {
·
Android {{ activeDevice()?.android_version }}
}
@if (isRemoteAdbServer()) {
·
Remote via {{ adbServerStatus()?.endpoint?.host }}:{{ adbServerStatus()?.endpoint?.port }}
}
已连接
@if (connectedDevices().length > 1) {
选择当前设备:
@for (dev of connectedDevices(); track dev.serial) {
}
}
}
@if (isEmulatorLaunching() || (!isDeviceReady() && adbProbe()?.summary === 'Device Booting')) {
= 35" [class.active]="emulatorLaunchState()?.status === 'starting'">
@if (emulatorLaunchState()?.progress_percent! >= 35) {
check
} @else {
}
1. 启动进程
= 35">
= 65" [class.active]="emulatorLaunchState()?.status === 'waiting_for_adb'">
@if (emulatorLaunchState()?.progress_percent! >= 65) {
check
} @else if (emulatorLaunchState()?.status === 'waiting_for_adb') {
} @else {
2
}
2. ADB 连接
= 65">
@if (emulatorLaunchState()?.status === 'ready') {
check
} @else if (emulatorLaunchState()?.status === 'booting' || adbProbe()?.summary === 'Device Booting') {
} @else {
3
}
3. 系统启动
{{ emulatorLaunchState()?.progress_percent || 25 }}% Complete
timer
Elapsed: {{ emulatorLaunchState()?.elapsed_seconds || 0 }}s
info
Android 模拟器冷启动通常需要 20–45 秒。上方会显示实时进度,请勿重复点击启动。
@if (showLaunchLogs()) {
@if (emulatorLaunchState()?.logs?.length) {@for (log of emulatorLaunchState()?.logs; track log) {{{ log }}
}} @else {正在等待进程输出…
}
}
}
@if (!isDeviceReady() && !isEmulatorLaunching() && emulatorLaunchState()?.status === 'failed') {
@if (emulatorLaunchState()?.logs?.length) {
@for (log of emulatorLaunchState()?.logs; track log) {{{ log }}
}
}
@if (emulatorLaunchState()?.avd_name) {
}
}
@if (showConnectionMethods() || (!isDeviceReady() && !isEmulatorLaunching() && adbProbe()?.summary !== 'Device Booting' && adbProbe()?.summary !== 'Device Unauthorized' && adbProbe()?.summary !== 'Device Locked' && adbProbe()?.summary !== 'Lock State Unknown' && adbProbe()?.status !== 'fail' && emulatorLaunchState()?.status !== 'failed')) {
@if (activeAdbGuideTab() !== 'remote' && isRemoteAdbServer()) {
hub
Artemis 当前使用
{{ adbServerStatus()?.endpoint?.host }}:{{ adbServerStatus()?.endpoint?.port }}。使用本地模拟器、USB 或无线 ADB 前,请先切换至本地 ADB。
}
@if (activeAdbGuideTab() === 'emulator') {
@if (installedAvds().length > 0) {
@for (avd of installedAvds(); track avd) {
}
} @else {
devices_off
未检测到 Android 虚拟设备(AVD)
按以下步骤安装并启动模拟器:
@if (emulatorSetupMode() === 'studio') {
安装 Android Studio
Download for {{ effectiveOs() === 'darwin' ? 'macOS' : (effectiveOs() === 'windows' ? 'Windows' : 'Linux') }} from
developer.android.com/studio 并安装。
打开设备管理器
在 Android Studio 欢迎页面打开 更多操作 > 虚拟设备管理器 (或 工具 > 设备管理器).
创建虚拟设备
点击 创建设备,选择 Pixel 8,选择 Android 14 (API 34),然后点击 完成.
启动模拟器
点击 ▶ 播放 。Artemis 会自动检测并连接设备。
}
@if (emulatorSetupMode() === 'cli') {
1
{{ emuHypervisorTitle() }}
{{ emuHypervisorDesc() }}
{{ effectiveOs() === 'windows' ? 'PS>' : '$' }}
{{ emuHypervisorCmd() }}
2
下载模拟器与系统镜像(API 34)
通过 SDK 管理器安装 Android 14 Google APIs 系统镜像:
{{ effectiveOs() === 'windows' ? 'PS>' : '$' }}
{{ emuSdkInstallCmd() }}
3
创建虚拟设备(Pixel 8 AVD)
创建 Android 虚拟设备,名称为 Pixel_8_API_34:
{{ effectiveOs() === 'windows' ? 'PS>' : '$' }}
{{ emuCreateAvdCmd() }}
4
启动模拟器
启动虚拟设备(可添加 -no-window 以无界面模式运行):
{{ effectiveOs() === 'windows' ? 'PS>' : '$' }}
emulator -avd Pixel_8_API_34 -no-boot-anim
}
}
}
@if (activeAdbGuideTab() === 'usb') {
cable
通过 USB 数据线连接 Android 手机,并启用 USB 调试:
连接 USB 数据线
使用数据线将 Android 手机连接到此计算机。
启用开发者选项
在手机上打开 设置 > 关于手机,点击 版本号 7 次。
启用 USB 调试
在 设置 > 开发者选项中,将 USB 调试 开启。
授权计算机
勾选 “始终允许” ,然后点击 允许 完成手机上的授权提示。
}
@if (activeAdbGuideTab() === 'wifi') {
wifi
将手机和计算机连接到同一 Wi-Fi 网络:
@if (wifiConnectMessage()) {
check_circle
{{ wifiConnectMessage() }}
}
@if (wifiConnectError()) {
error
{{ wifiConnectError() }}
}
help_outline
在手机中查看 IP 地址与端口: 设置 > 开发者选项 > 无线调试.
}
@if (activeAdbGuideTab() === 'remote') {
hub
输入本机可访问的 ADB 服务器地址和端口,即可发现并控制连接在其他计算机上的手机。
@if (remoteAdbMessage()) {
check_circle
{{ remoteAdbMessage() }}
}
@if (remoteAdbError()) {
error
{{ remoteAdbError() }}
}
@if (remoteAdbDevices().length > 0) {
@for (device of remoteAdbDevices(); track device.serial) {
phone_android
{{ device.model || device.serial }}
{{ device.serial }}
{{ device.state === 'device' ? '就绪' : device.state }}
}
}
@if (remoteAdbProbeResult()?.success && !isProbedRemoteAdbActive()) {
}
Artemis 将向此服务器发送 ADB 命令,并使用该服务器能够发现的手机。
}
}
@if (adbProbe()?.status === 'warn' && (adbProbe()?.summary === 'Device Locked' || adbProbe()?.summary === 'Lock State Unknown')) {
lock
{{ adbProbe()?.summary === 'Device Locked' ? 'Device Is Locked' : 'Unable to Verify Lock State' }}
{{ adbProbe()?.description }}
@if (connectedDevices().length > 1) {
选择当前设备:
@for (dev of connectedDevices(); track dev.serial) {
}
}
}
@if (adbProbe()?.status === 'warn' && adbProbe()?.summary === 'Device Unauthorized') {
screen_lock_portrait
等待 USB 调试授权
已检测到 Android 设备,但尚未授权。请解锁手机并点击 “允许 USB 调试”.
}
@if (adbProbe()?.status === 'fail') {
error
未找到 Android 平台工具(adb)。 请在当前操作系统中安装 ADB:
Linux (Ubuntu / Debian)
@if (effectiveOs() === 'linux') {
已检测到
}
$
sudo apt-get install -y adb
macOS (Homebrew)
@if (effectiveOs() === 'darwin') {
已检测到
}
$
brew install android-platform-tools
Windows (WinGet)
@if (effectiveOs() === 'windows') {
已检测到
}
>
winget install Google.PlatformTools
}