Skip to content

Commit

Permalink
Version 0.1.4
Browse files Browse the repository at this point in the history
Added preexec command
  • Loading branch information
yezhiyi9670 committed Aug 12, 2022
1 parent 894d4c1 commit 9e51665
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ <h2 class="settings-subtitle">Functionalities</h2>
</p>
<p class="settings-explain">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.</p>
<h2 class="settings-subtitle">Advanced</h2>
<wcl-settings-field-text key="preexec" label="Pre-execute command"></wcl-settings-field-text>
<wcl-settings-field-text key="emulator_args" label="Extra emulator arguments"></wcl-settings-field-text>
<wcl-settings-field-text key="qemu_args" label="Extra qemu arguments"></wcl-settings-field-text>
<p class="settings-explain">Advanced users only. Add extra control arguments.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "avd-launcher",
"version": "0.1.2",
"version": "0.1.4",
"main": "main.js",
"icon": "./icon/launcher.png",
"scripts": {
Expand Down
16 changes: 16 additions & 0 deletions static/js/common/settings-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ module.exports = {
validator_arg: ['sdk_root', 'cli_ver'],
default: 'latest'
},
preexec: {
type: 'text',
validator: () => {
return {pass: true, message: 'You can use this to set environment variables.'}
},
validator_arg: [],
default: ''
},
emulator_args: {
type: 'text',
validator: () => {
Expand All @@ -46,6 +54,14 @@ module.exports = {
validator_arg: [],
default: ''
},
qemu_args: {
type: 'text',
validator: () => {
return {pass: true, message: 'Arguments to pass to qemu core.'}
},
validator_arg: [],
default: ''
},
func_reset_system: {
type: 'bool',
default: true
Expand Down
6 changes: 5 additions & 1 deletion static/js/common/virtual-devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ 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' : ''} ${SettingsProvider.get('emulator_args')} -avd ${this.name}`;
let command = `"${emulator_exec}"${useWritableSystem ? ' -writable-system' : ''} ${SettingsProvider.get('emulator_args')} -avd ${this.name} -qemu ${SettingsProvider.get('qemu_args')}`;
let preexec = SettingsProvider.get('preexec');
if(preexec != '') {
command = preexec + '&' + command;
}
child_process.exec(command);
return {pass: true, message: "Emulator launched."};
};
Expand Down

0 comments on commit 9e51665

Please sign in to comment.