From cc1c425d19d917fa36b3dbfe3e0d1f4e69922075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E9=9D=99=E5=87=A1?= <30424139+wtto00@users.noreply.github.com> Date: Fri, 22 Sep 2023 02:10:38 +0800 Subject: [PATCH] chore: readme --- README-ZH_CN.md | 32 ++++++++++++++++++++++++++++---- README.md | 32 ++++++++++++++++++++++++++++---- src/emulator.ts | 8 ++++---- 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/README-ZH_CN.md b/README-ZH_CN.md index e9aad4d..26f2f9b 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -40,7 +40,11 @@ Andorid Options ```js android - .start('android-avd-name') + .start( + avd: 'android-avd-name', + verbose: true + // ... + ) .then((res) => { console.log(`emulatorId: ${res.id}`); }) @@ -49,9 +53,29 @@ android }); ``` -| field | type | required | default | note | -| ------- | ------ | -------- | ------- | ---------- | -| avdName | string | true | - | 模拟器名称 | +| field | type | required | default | note | +| -------------------- | ------------------------------------------------------------------------------ | -------- | ------- | ------------------------------------------------------------------ | +| avd | string | true | - | 使用特定的android虚拟设备 | +| verbose | boolean | true | - | 启用特定的调试消息 | +| noWindow | boolean | false | - | 禁用图形窗口显示 | +| noSnapshot | boolean | false | - | 执行完全引导,不自动保存,但qemu vmload和vmsave在snapstorage上操作 | +| noSnapstorage | boolean | false | - | 不要装载快照存储文件(这将禁用所有快照功能) | +| noSnapshotUpdateTime | boolean | false | - | 在还原时不要尝试更正快照时间 | +| noSnapshotSave | boolean | false | - | 退出时不自动保存到快照:放弃已更改的状态 | +| noSnapshotLoad | boolean | false | - | 不要从快照自动启动:执行完全启动 | +| cameraBack | "emulated","virtualscene","videoplayback","none","webcam" | false | - | 为背面的相机设置模拟模式 | +| cameraFront | 'emulated','webcam','none' | false | - | 为前置摄像头设置模拟模式 | +| gpu | 'auto','auto-no-window','host','swiftshader_indirect','angle_indirect','guest' | false | 'auto' | 设置硬件OpenGLES仿真模式 | +| nocache | boolean | false | - | 禁用缓存分区 | +| noaudio | boolean | false | - | 禁用音频支持 | +| noBootAnim | boolean | false | - | 禁用动画以加快启动速度 | +| lowram | boolean | false | - | 该设备是一种低ram设备 | +| restartWhenStalled | boolean | false | - | 允许在来宾停止时重新启动。 | +| waitForDebugger | boolean | false | - | 启动时暂停,等待调试器进程附加后再继续 | +| httpProxy | string | false | - | 通过HTTP/HTTPS代理进行TCP连接 | +| cores | number | false | - | 将CPU核心数设置为模拟器 | +| wipeData | boolean | false | - | 重置用户数据映像(从initdata复制) | +| noPassiveGps | boolean | false | - | 禁用被动gps更新 | ### waitForDevice diff --git a/README.md b/README.md index fb938dd..a302b20 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,11 @@ Start the emulator using the AVD supplied through with `avdName`. ```js android - .start('android-avd-name') + .start({ + avd: 'android-avd-name', + verbose: true + // ... + }) .then((res) => { console.log(`emulatorId: ${res.id}`); }) @@ -49,9 +53,29 @@ android }); ``` -| field | type | required | default | note | -| ------- | ------ | -------- | ------- | ----------- | -| avdName | string | true | - | Name of AVD | +| field | type | required | default | note | +| -------------------- | ------------------------------------------------------------------------------ | -------- | ------- | ------------------------------------------------------------------------------------------- | +| avd | string | true | - | use a specific android virtual device | +| verbose | boolean | true | - | enable specific debug messages | +| noWindow | boolean | false | - | disable graphical window display | +| noSnapshot | boolean | false | - | perform a full boot and do not auto-save, but qemu vmload and vmsave operate on snapstorage | +| noSnapstorage | boolean | false | - | do not mount a snapshot storage file (this disables all snapshot functionality) | +| noSnapshotUpdateTime | boolean | false | - | do not try to correct snapshot time on restore | +| noSnapshotSave | boolean | false | - | do not auto-save to snapshot on exit: abandon changed state | +| noSnapshotLoad | boolean | false | - | do not auto-start from snapshot: perform a full boot | +| cameraBack | "emulated","virtualscene","videoplayback","none","webcam" | false | - | set emulation mode for a camera facing back | +| cameraFront | 'emulated','webcam','none' | false | - | set emulation mode for a camera facing front | +| gpu | 'auto','auto-no-window','host','swiftshader_indirect','angle_indirect','guest' | false | 'auto' | set hardware OpenGLES emulation mode | +| nocache | boolean | false | - | disable the cache partition | +| noaudio | boolean | false | - | disable audio support | +| noBootAnim | boolean | false | - | disable animation for faster boot | +| lowram | boolean | false | - | device is a low ram device | +| restartWhenStalled | boolean | false | - | Allows restarting guest when it is stalled. | +| waitForDebugger | boolean | false | - | Pause on launch and wait for a debugger process to attach before resuming | +| httpProxy | string | false | - | make TCP connections through a HTTP/HTTPS proxy | +| cores | number | false | - | Set number of CPU cores to emulator | +| wipeData | boolean | false | - | reset the user data image (copy it from initdata) | +| noPassiveGps | boolean | false | - | disable passive gps updates | ### waitForDevice diff --git a/src/emulator.ts b/src/emulator.ts index 0f457e8..2d04c1d 100644 --- a/src/emulator.ts +++ b/src/emulator.ts @@ -1,4 +1,8 @@ export interface EmulatorOptions { + /** use a specific android virtual device */ + avd?: string; + /** enable specific debug messages */ + verbose?: boolean; /** disable graphical window display */ noWindow?: boolean; /** perform a full boot and do not auto-save, but qemu vmload and vmsave operate on snapstorage */ @@ -37,10 +41,6 @@ export interface EmulatorOptions { wipeData?: boolean; /** disable passive gps updates */ noPassiveGps?: boolean; - /** use a specific android virtual device */ - avd?: string; - /** enable specific debug messages */ - verbose?: boolean; } /**