From 894d4c180c74cb8fa89abae8897d2f03edca1570 Mon Sep 17 00:00:00 2001 From: yezhiyi9670 <2738558298@qq.com> Date: Fri, 12 Aug 2022 09:50:01 +0800 Subject: [PATCH] Version 0.1.2 Added support for custom emulator arguments --- index.html | 3 +++ package.json | 2 +- static/js/common/settings-data.js | 8 ++++++++ static/js/common/virtual-devices.js | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2116d49..660ae90 100644 --- a/index.html +++ b/index.html @@ -80,6 +80,9 @@

Functionalities

Writable system image allows for system modifications, such as installing ARM support and Rooting. Changes to system in one virtual device does not affect another.

+

Advanced

+ +

Advanced users only. Add extra control arguments.

diff --git a/package.json b/package.json index 3d7e85a..7d25c85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "avd-launcher", - "version": "0.1.1", + "version": "0.1.2", "main": "main.js", "icon": "./icon/launcher.png", "scripts": { diff --git a/static/js/common/settings-data.js b/static/js/common/settings-data.js index ee43c1f..7f10372 100644 --- a/static/js/common/settings-data.js +++ b/static/js/common/settings-data.js @@ -38,6 +38,14 @@ module.exports = { validator_arg: ['sdk_root', 'cli_ver'], default: 'latest' }, + emulator_args: { + type: 'text', + validator: () => { + return {pass: true, message: 'Please do not include -writable-system.'} + }, + validator_arg: [], + default: '' + }, func_reset_system: { type: 'bool', default: true diff --git a/static/js/common/virtual-devices.js b/static/js/common/virtual-devices.js index dc0751a..3b3281c 100644 --- a/static/js/common/virtual-devices.js +++ b/static/js/common/virtual-devices.js @@ -80,7 +80,7 @@ const child_process = require('child_process'); if(this.isRunning()) { return {pass: false, error: 'already_running', message: "Emulator is already running."}; } - let command = `"${emulator_exec}"${useWritableSystem ? ' -writable-system' : ''} -avd ${this.name}`; + let command = `"${emulator_exec}"${useWritableSystem ? ' -writable-system' : ''} ${SettingsProvider.get('emulator_args')} -avd ${this.name}`; child_process.exec(command); return {pass: true, message: "Emulator launched."}; };