parse ipad name

This commit is contained in:
Vadim 2024-05-15 22:14:28 +02:00
parent eaa9061ca8
commit 8938b40271
2 changed files with 8 additions and 9 deletions

View file

@ -15,14 +15,14 @@ class ScreenshotArgs {
required this.platformFolder, required this.platformFolder,
required this.backgroundColor, required this.backgroundColor,
required this.isDark, required this.isDark,
}) : deviceName = deviceName.replaceAll(' ', _pathArgsDelimited).toLowerCase(); }) : deviceName = deviceName.replaceAll(' ', _pathArgsDelimited).replaceAll(RegExp('[(|)]'), '').toLowerCase();
ScreenshotArgs.fromRawName({ ScreenshotArgs.fromRawName({
required String name, required String name,
required String deviceName, required String deviceName,
required this.platformFolder, required this.platformFolder,
}) : name = name.split(_pathArgsDelimited)[1], }) : name = name.split(_pathArgsDelimited)[1],
deviceName = deviceName.replaceAll(' ', _pathArgsDelimited).toLowerCase(), deviceName = deviceName.replaceAll(' ', _pathArgsDelimited).replaceAll(RegExp('[(|)]'), '').toLowerCase(),
backgroundColor = name.split(_pathArgsDelimited)[2], backgroundColor = name.split(_pathArgsDelimited)[2],
isDark = name.contains('dark'); isDark = name.contains('dark');

View file

@ -1,13 +1,12 @@
devices_array=("iPhone 8 Plus" "iPhone 13 Pro" "iPhone 13 Pro Max" "iPhone 15 Pro" "iPhone 15 Pro Max" "iPad Pro (12.9-inch) (6th generation)") simulators_array=("iPhone 13 Pro" "iPad Pro (12.9-inch) (6th generation)")
open -a Simulator open -a Simulator
for i in "${simulators_array[@]}"; do # https://www.baeldung.com/linux/shell-script-iterate-over-string-list#2-understanding--and--special-indices
for i in "${devices_array[@]}"; do # https://www.baeldung.com/linux/shell-script-iterate-over-string-list#2-understanding--and--special-indices
echo "$i" echo "$i"
xcrun simctl boot "$i" xcrun simctl boot "$i"
#uid=$(echo "$(fvm flutter devices)" | sed -n -r "s/$i \(mobile\) • (.*) • .* • .*\(simulator\)/\1/p")
#echo $uid
sh screenshots/scripts/generate_screenshots.sh "$i" sh screenshots/scripts/generate_screenshots.sh "$i"
done done
killall 'Simulator' killall 'Simulator'
# dart run screenshots/main.dart -p ios -d iphone_13_pro -l iphone55inch
# dart run screenshots/main.dart -p ios -d iphone_13_pro -l iphone65inch
# dart run screenshots/main.dart -p ios -d ipad_pro_12.9-inch_6th_generation -l ipad13inch