Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ControlRoom/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,16 @@
}
}
},
"Show Slow Animations" : {
"localizations" : {
"ar" : {
"stringUnit" : {
"state" : "translated",
"value" : "أظهر رسوم متحركة بطيئة"
}
}
}
},
"Show system apps" : {
"localizations" : {
"ar" : {
Expand Down
14 changes: 14 additions & 0 deletions ControlRoom/Simulator UI/ControlScreens/OverridesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct OverridesView: View {

@State private var enhanceTextLegibility = false
@State private var showButtonShapes = false
@State private var showSlowAnimations = false
@State private var showOnOffLabels = false
@State private var reduceTransparency = false
@State private var increaseContrast = false
Expand Down Expand Up @@ -95,6 +96,7 @@ struct OverridesView: View {

Toggle("Bold Text", isOn: $enhanceTextLegibility.onChange(setEnhanceTextLegibility))
Toggle("Button Shapes", isOn: $showButtonShapes.onChange(setShowButtonShapes))
Toggle("Show Slow Animations", isOn: $showSlowAnimations.onChange(setSlowAnimations))
Toggle("On/Off Labels", isOn: $showOnOffLabels.onChange(setShowOnOffLabels))
Toggle("Reduce Transparency", isOn: $reduceTransparency.onChange(setReduceTransparency))
Toggle("Increase Contrast", isOn: $increaseContrast.onChange(setIncreaseContrast))
Expand Down Expand Up @@ -141,6 +143,18 @@ struct OverridesView: View {
SimCtl.setContentSize(simulator.udid, contentSize: contentSize)
}

func sendDarvinNotification(key: String, value: Bool) {
// Slow animations are toggled via a Darwin notification state inside the simulator:
// set the state with `notifyutil -s`, then post it with `-p` so running apps pick it up.
let name = "com.apple.UIKit." + key
_ = Process.execute("/usr/bin/xcrun", arguments: ["simctl", "spawn", simulator.id, "notifyutil", "-s", name, value ? "1" : "0"])
_ = Process.execute("/usr/bin/xcrun", arguments: ["simctl", "spawn", simulator.id, "notifyutil", "-p", name])
}

func setSlowAnimations() {
sendDarvinNotification(key: "SimulatorSlowMotionAnimationState", value: showSlowAnimations)
}

// Updates the simulator's accessibility setting for a particular key.
// Example call: xcrun simctl spawn booted defaults write com.apple.Accessibility EnhancedTextLegibilityEnabled -bool FALSE
func updateAccessibility(key: String, value: Bool) {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Control Room is packed with features to help you develop apps more effectively,
- Controlling status of WiFi, cellular service, and battery.
- Opening the data folder for your app, or editing your `UserDefaults` entries.
- Overriding dark or light mode, language, accessibility options, and Dynamic Type content size.
- Activating slow animations in the simulator. This sadly does not work on a real device.
- Picking a custom user location from anywhere in the world.
- Starting, stopping, installing, and removing apps.
- Sending test push notifications or triggering deep links.
Expand Down