@@ -2,9 +2,9 @@ import * as exec from '@actions/exec';
22import * as fs from 'fs' ;
33
44/**
5- * Creates and launches a new AVD instance with the specified configurations.
5+ * Creates a new AVD instance with the specified configurations.
66 */
7- export async function launchEmulator (
7+ export async function createAvd (
88 systemImageApiLevel : string ,
99 target : string ,
1010 arch : string ,
@@ -16,16 +16,10 @@ export async function launchEmulator(
1616 diskSize : string ,
1717 avdName : string ,
1818 forceAvdCreation : boolean ,
19- emulatorBootTimeout : number ,
20- port : number ,
21- emulatorOptions : string ,
22- disableAnimations : boolean ,
23- disableSpellChecker : boolean ,
24- disableLinuxHardwareAcceleration : boolean ,
2519 enableHardwareKeyboard : boolean
2620) : Promise < void > {
2721 try {
28- console . log ( `::group::Launch Emulator ` ) ;
22+ console . log ( `::group::Create AVD ` ) ;
2923 // create a new AVD if AVD directory does not already exist or forceAvdCreation is true
3024 const avdPath = `${ process . env . ANDROID_AVD_HOME } /${ avdName } .avd` ;
3125 if ( ! fs . existsSync ( avdPath ) || forceAvdCreation ) {
@@ -61,6 +55,26 @@ export async function launchEmulator(
6155 await exec . exec ( `sh -c \\"printf '${ configContent } ' >> ${ process . env . ANDROID_AVD_HOME } /"${ avdName } ".avd"/config.ini"` ) ;
6256 }
6357 }
58+ } finally {
59+ console . log ( `::endgroup::` ) ;
60+ }
61+ }
62+
63+ /**
64+ * Launches an existing AVD instance with the specified configurations.
65+ */
66+ export async function launchEmulator (
67+ avdName : string ,
68+ emulatorBootTimeout : number ,
69+ port : number ,
70+ emulatorOptions : string ,
71+ disableAnimations : boolean ,
72+ disableSpellChecker : boolean ,
73+ disableLinuxHardwareAcceleration : boolean ,
74+ enableHardwareKeyboard : boolean
75+ ) : Promise < void > {
76+ try {
77+ console . log ( `::group::Launch Emulator` ) ;
6478
6579 // turn off hardware acceleration on Linux
6680 if ( process . platform === 'linux' && disableLinuxHardwareAcceleration ) {
0 commit comments