Skip to content

Commit

Permalink
Improve device specs message for maestro cloud command to include dev…
Browse files Browse the repository at this point in the history
…ice locale (#1588)

* improve device specs message for maestro cloud command to include device locale

* code review fixes
  • Loading branch information
artem888 authored Nov 15, 2023
1 parent 82e7cc6 commit 743e62a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,18 @@ class CloudInteractor(

val platform = Platform.fromString(deviceInfo.platform)

val line1 = "Maestro Cloud device specs:\n* ${deviceInfo.displayInfo}"
val line1 = "Maestro Cloud device specs:\n* ${deviceInfo.displayInfo} - ${deviceInfo.deviceLocale}"
val line2 = "To change OS version use this option: ${if (platform == Platform.IOS) "--ios-version=<version>" else "--android-api-level=<version>"}"
val line3 = "To change device locale use this option: --device-locale=<device_locale>"

val version = when(platform) {
Platform.ANDROID -> "${androidApiLevel ?: 30}" // todo change with constant from DeviceConfigAndroid
Platform.IOS -> "${iOSVersion ?: 15}" // todo change with constant from DeviceConfigIos
else -> return
}

val line3 = "To create a similar device locally, run: `maestro start-device --platform=${platform.toString().lowercase()} --os-version=$version`"
PrintUtils.message("$line1\n\n$line2\n\n$line3".box())
val line4 = "To create a similar device locally, run: `maestro start-device --platform=${platform.toString().lowercase()} --os-version=$version --device-locale=${deviceInfo.deviceLocale}`"
PrintUtils.message("$line1\n\n$line2\n\n$line3\n\n$line4".box())
}


Expand Down

0 comments on commit 743e62a

Please sign in to comment.