Skip to content

Commit c06a397

Browse files
committed
Add HealthKit entitlement and expand Fastlane screenshot lanes
Enabled HealthKit capability for the Watch app. Updated Info.plist to include permitted background task identifiers. Enhanced Fastlane configuration to support Apple Watch screenshot generation, multi-language support, and improved version/build handling. Updated Fastlane README with new screenshot lanes.
1 parent 5781131 commit c06a397

File tree

5 files changed

+79
-5
lines changed

5 files changed

+79
-5
lines changed

MirrorSmokerStopper Watch App/MirrorSmokerStopper Watch App.entitlements

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@
1616
<array>
1717
<string>group.fightthestroke.mirrorsmoker</string>
1818
</array>
19+
<key>com.apple.developer.healthkit</key>
20+
<true/>
1921
</dict>
2022
</plist>

MirrorSmokerStopper/Info.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
<string>processing</string>
1818
<string>remote-notification</string>
1919
</array>
20+
<key>BGTaskSchedulerPermittedIdentifiers</key>
21+
<array>
22+
<string>com.mirror-labs.mirrorsmoker.refresh</string>
23+
<string>com.mirror-labs.mirrorsmoker.processing</string>
24+
</array>
2025
<key>UILaunchScreen</key>
2126
<dict/>
2227
<key>UIAppFonts</key>

fastlane/Fastfile

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,14 @@ platform :ios do
205205
clear_previous_screenshots: true,
206206
override_status_bar: true,
207207
devices: [
208-
"iPhone 16 Pro Max"
208+
"RoberdanTests26"
209209
],
210210
languages: [
211-
"en-US"
211+
"en-US",
212+
"es-ES",
213+
"fr-FR",
214+
"de-DE",
215+
"it-IT"
212216
],
213217
launch_arguments: [
214218
"-FASTLANE_SNAPSHOT YES",
@@ -218,6 +222,45 @@ platform :ios do
218222
)
219223
end
220224

225+
# Generate Apple Watch Screenshots
226+
desc "Generate Apple Watch screenshots using UI tests"
227+
lane :watch_screenshots do
228+
UI.message("📱 Generating Apple Watch screenshots...")
229+
230+
capture_screenshots(
231+
project: "MirrorSmokerStopper.xcodeproj",
232+
scheme: "MirrorSmokerStopper Watch App",
233+
configuration: "Release",
234+
test_target_name: "MirrorSmokerStopper Watch AppUITests",
235+
output_directory: "./fastlane/screenshots/watch",
236+
clear_previous_screenshots: true,
237+
override_status_bar: true,
238+
devices: [
239+
"RoberdanWatch26"
240+
],
241+
languages: [
242+
"en-US",
243+
"es-ES",
244+
"fr-FR",
245+
"de-DE",
246+
"it-IT"
247+
],
248+
launch_arguments: [
249+
"-FASTLANE_SNAPSHOT YES",
250+
"-ui_testing",
251+
"SCREENSHOT_MODE"
252+
]
253+
)
254+
end
255+
256+
# Generate both iPhone and Watch Screenshots
257+
desc "Generate screenshots for both iPhone and Apple Watch"
258+
lane :all_screenshots do
259+
UI.message("📱 Generating screenshots for iPhone and Apple Watch...")
260+
screenshots
261+
watch_screenshots
262+
end
263+
221264
# Generate Screenshots and Deliver to App Store Connect
222265
desc "Generate screenshots and upload to App Store Connect"
223266
lane :screenshots_and_upload do
@@ -432,9 +475,17 @@ platform :ios do
432475

433476
# 2. Versioning manuale (niente agvtool / increment_* Fastlane)
434477
plist_path = "MirrorSmokerStopper/Info.plist"
478+
unless File.exist?(plist_path)
479+
UI.important("[release] #{plist_path} mancante: lo creo minimale")
480+
File.write(plist_path, <<~PL)
481+
<?xml version="1.0" encoding="UTF-8"?>
482+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
483+
<plist version="1.0"><dict></dict></plist>
484+
PL
485+
end
435486
# Leggi versione corrente dal plist (fallback 1.0.0 se mancante)
436-
current_v = ` /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "#{plist_path}" 2>/dev/null`.strip
437-
current_v = "1.0.0" if current_v.empty?
487+
current_v = ` /usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' '#{plist_path}' 2>/dev/null || echo ''`.strip
488+
current_v = "1.0.0" if current_v.empty? || current_v =~ /File Doesn't Exist/i
438489
if ENV['NEW_VERSION'] && !ENV['NEW_VERSION'].empty?
439490
new_version = ENV['NEW_VERSION']
440491
else
@@ -477,7 +528,7 @@ platform :ios do
477528
end
478529

479530
# 3. Build number manuale
480-
current_build = ` /usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "#{plist_path}" 2>/dev/null`.strip
531+
current_build = `/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' '#{plist_path}' 2>/dev/null || echo ''`.strip
481532
if ENV['USE_TIMESTAMP_BUILD'] == '1'
482533
new_build = Time.now.strftime('%Y%m%d%H%M')
483534
else

fastlane/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ Solo normalizza dimensioni screenshot (senza rigenerarli)
6363

6464
Generate screenshots quickly for development
6565

66+
### ios watch_screenshots
67+
68+
```sh
69+
[bundle exec] fastlane ios watch_screenshots
70+
```
71+
72+
Generate Apple Watch screenshots using UI tests
73+
74+
### ios all_screenshots
75+
76+
```sh
77+
[bundle exec] fastlane ios all_screenshots
78+
```
79+
80+
Generate screenshots for both iPhone and Apple Watch
81+
6682
### ios screenshots_and_upload
6783

6884
```sh

0 commit comments

Comments
 (0)