Skip to content

Commit f932e6f

Browse files
authored
Merge pull request #3 from cem2ran/feat/start-multiple-android-emulators
Add shard index option to StartDeviceCommand
2 parents a3609e1 + ef308a1 commit f932e6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

maestro-cli/src/main/java/maestro/cli/command/StartDeviceCommand.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ class StartDeviceCommand : Callable<Int> {
6464
)
6565
private var forceCreate: Boolean = false
6666

67+
@CommandLine.Option(
68+
order = 5,
69+
names = ["--shard-index"],
70+
description = ["Shard index to use for the device"],
71+
)
72+
private var shardIndex: Int? = null
73+
6774
override fun call(): Int {
6875
TestDebugReporter.install(null, printToConsole = parent?.verbose == true)
6976

@@ -95,7 +102,7 @@ class StartDeviceCommand : Callable<Int> {
95102
try {
96103
val (deviceLanguage, deviceCountry) = LocaleUtils.parseLocaleParams(locale, maestroPlatform)
97104

98-
DeviceCreateUtil.getOrCreateDevice(p, o, deviceLanguage, deviceCountry, forceCreate).let { device ->
105+
DeviceCreateUtil.getOrCreateDevice(p, o, deviceLanguage, deviceCountry, forceCreate, shardIndex).let { device ->
99106
PrintUtils.message(if (p == Platform.IOS) "Launching simulator..." else "Launching emulator...")
100107
DeviceService.startDevice(
101108
device = device,

0 commit comments

Comments
 (0)