File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
maestro-client/src/main/java/maestro/device Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -56,15 +56,26 @@ object DeviceService {
5656 Platform .ANDROID -> {
5757 val emulatorBinary = requireEmulatorBinary()
5858
59- ProcessBuilder (
59+ val emulatorArgs = mutableListOf (
6060 emulatorBinary.absolutePath,
6161 " -avd" ,
6262 device.modelId,
6363 " -netdelay" ,
6464 " none" ,
6565 " -netspeed" ,
6666 " full"
67- ).start().waitFor(10 ,TimeUnit .SECONDS )
67+ )
68+
69+ // Support additional emulator flags via ANDROID_EMULATOR_FLAGS environment variable
70+ // Example: ANDROID_EMULATOR_FLAGS="-no-window -no-audio -gpu swiftshader_indirect"
71+ val extraFlags = System .getenv(" ANDROID_EMULATOR_FLAGS" )
72+ if (! extraFlags.isNullOrBlank()) {
73+ emulatorArgs.addAll(extraFlags.split(" \\ s+" .toRegex()).filter { it.isNotBlank() })
74+ logger.info(" Using additional emulator flags: $extraFlags " )
75+ }
76+
77+ ProcessBuilder (emulatorArgs)
78+ .start().waitFor(10 , TimeUnit .SECONDS )
6879
6980 var lastException: Exception ? = null
7081
You can’t perform that action at this time.
0 commit comments