@@ -32,16 +32,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3232 } ) ;
3333} ;
3434Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
35- exports . killEmulator = exports . launchEmulator = void 0 ;
35+ exports . killEmulator = exports . launchEmulator = exports . createAvd = void 0 ;
3636const exec = __importStar ( require ( "@actions/exec" ) ) ;
3737const fs = __importStar ( require ( "fs" ) ) ;
3838/**
39- * Creates and launches a new AVD instance with the specified configurations.
39+ * Creates a new AVD instance with the specified configurations.
4040 */
41- function launchEmulator ( systemImageApiLevel , target , arch , profile , cores , ramSize , heapSize , sdcardPathOrSize , diskSize , avdName , forceAvdCreation , emulatorBootTimeout , port , emulatorOptions , disableAnimations , disableSpellChecker , disableLinuxHardwareAcceleration , enableHardwareKeyboard ) {
41+ function createAvd ( arch , avdName , cores , diskSize , enableHardwareKeyboard , forceAvdCreation , heapSize , profile , ramSize , sdcardPathOrSize , systemImageApiLevel , target ) {
4242 return __awaiter ( this , void 0 , void 0 , function * ( ) {
4343 try {
44- console . log ( `::group::Launch Emulator ` ) ;
44+ console . log ( `::group::Create AVD ` ) ;
4545 // create a new AVD if AVD directory does not already exist or forceAvdCreation is true
4646 const avdPath = `${ process . env . ANDROID_AVD_HOME } /${ avdName } .avd` ;
4747 if ( ! fs . existsSync ( avdPath ) || forceAvdCreation ) {
@@ -72,6 +72,20 @@ function launchEmulator(systemImageApiLevel, target, arch, profile, cores, ramSi
7272 yield exec . exec ( `sh -c \\"printf '${ configContent } ' >> ${ process . env . ANDROID_AVD_HOME } /"${ avdName } ".avd"/config.ini"` ) ;
7373 }
7474 }
75+ }
76+ finally {
77+ console . log ( `::endgroup::` ) ;
78+ }
79+ } ) ;
80+ }
81+ exports . createAvd = createAvd ;
82+ /**
83+ * Launches an existing AVD instance with the specified configurations.
84+ */
85+ function launchEmulator ( avdName , disableAnimations , disableLinuxHardwareAcceleration , disableSpellChecker , emulatorBootTimeout , emulatorOptions , enableHardwareKeyboard , port ) {
86+ return __awaiter ( this , void 0 , void 0 , function * ( ) {
87+ try {
88+ console . log ( `::group::Launch Emulator` ) ;
7589 // turn off hardware acceleration on Linux
7690 if ( process . platform === 'linux' && disableLinuxHardwareAcceleration ) {
7791 console . log ( 'Disabling Linux hardware acceleration.' ) ;
0 commit comments