mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 15:00:40 +00:00
[iOS] implemented screenshots generator for all target devices
This commit is contained in:
parent
26f34977c1
commit
be2aa45afc
5 changed files with 42 additions and 6 deletions
|
@ -30,8 +30,5 @@ As a user I want to see the most relevant screenshots in the store, so that I ca
|
|||
|
||||
## Run the generator
|
||||
|
||||
```console
|
||||
sh screenshots/generate_screenshots.sh
|
||||
```
|
||||
|
||||
Screenshots will be stored in the _screenshots/_ folder.
|
||||
- Android
|
||||
- [iOS](screenshots/ios/README.md)
|
||||
|
|
|
@ -131,7 +131,7 @@ extension on WidgetTester {
|
|||
await binding.convertFlutterSurfaceToImage();
|
||||
await pumpAndSettle();
|
||||
}
|
||||
await binding.takeScreenshot("$_platformFolder/$name");
|
||||
await binding.takeScreenshot("$_platformFolder/${const String.fromEnvironment('deviceName')}/$name");
|
||||
await pumpAndSettle();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
deviceName="$1"
|
||||
|
||||
fvm flutter drive \
|
||||
-d "$deviceName" \
|
||||
--dart-define="cameraStubImage=assets/camera_stub_image.jpg" \
|
||||
--dart-define="deviceName=$deviceName" \
|
||||
--driver=test_driver/screenshot_driver.dart \
|
||||
--target=screenshots/generate_screenshots.dart \
|
||||
--debug \
|
||||
|
|
22
screenshots/ios/README.md
Normal file
22
screenshots/ios/README.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Generate iOS screenshots
|
||||
|
||||
## Context
|
||||
|
||||
The command below will generate screenshots for all the screen sizes required by App Store using iOS Simulator.
|
||||
|
||||
## Run the generator
|
||||
|
||||
```console
|
||||
sh screenshots/ios/generate_screenshots.sh
|
||||
```
|
||||
|
||||
Screenshots will be stored in the _screenshots/ios/generated/_ folder.
|
||||
|
||||
## List of devices
|
||||
|
||||
- iPhone 8 Plus
|
||||
- iPhone 13 Pro
|
||||
- iPhone 13 Pro Max
|
||||
- iPhone 15 Pro
|
||||
- iPhone 15 Pro Max
|
||||
- iPad Pro (12.9-inch) (6th generation)
|
13
screenshots/ios/generate_screenshots.sh
Normal file
13
screenshots/ios/generate_screenshots.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
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)")
|
||||
|
||||
open -a Simulator
|
||||
|
||||
for i in "${devices_array[@]}"; do # https://www.baeldung.com/linux/shell-script-iterate-over-string-list#2-understanding--and--special-indices
|
||||
echo "$i"
|
||||
xcrun simctl boot "$i"
|
||||
#uid=$(echo "$(fvm flutter devices)" | sed -n -r "s/$i \(mobile\) • (.*) • .* • .*\(simulator\)/\1/p")
|
||||
#echo $uid
|
||||
sh screenshots/generate_screenshots.sh "$i"
|
||||
done
|
||||
|
||||
killall 'Simulator'
|
Loading…
Reference in a new issue