Explorar o código

beautify screenshots: no status icon, set time to 12:00, no charging, etc.

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky %!s(int64=5) %!d(string=hai) anos
pai
achega
9246373e36
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      fastlane/Fastfile

+ 11 - 0
fastlane/Fastfile

@@ -14,6 +14,7 @@ skip_docs
 ## public lanes
 
 lane :screenshotsPhone do
+    beautifyPhone()
     build_for_screengrab()
 
     screengrab(
@@ -24,6 +25,7 @@ lane :screenshotsPhone do
 end
 
 lane :screenshotsTablet do
+    beautifyPhone()
     build_for_screengrab()
 
     screengrab(
@@ -105,6 +107,15 @@ lane :createDevRelease do |options|
     sh("mv ../build/outputs/apk/versionDev/release/*.apk ../release/")
 end
 
+desc "Beautify phone for screenshots: set time, remove other icons, no charging"
+lane :beautifyPhone do
+    sh("adb shell settings put global sysui_demo_allowed 1")
+    sh("adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200")
+    sh("adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false")
+    sh("adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false")
+    sh("adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100")
+end
+
 ## private lanes
 
 desc "Build debug and test APK for screenshots"