less than 1 minute read

Opening the curtains (iOS/Android)

Swiping, swiping, swiping. From dusk till dawn.

iOS

Preview
extension XCUIApplication {
    func openNotifications() {
        let up = self.coordinate(withNormalizedOffset: CGVector(dx: 0.1, dy: 0.001))
        let down = self.coordinate(withNormalizedOffset: CGVector(dx: 0.1, dy: 0.8))
        up.press(forDuration: 0.1, thenDragTo: down)
    }
}
Preview
extension XCUIApplication {
    func openControlCenter() {
        let down = self.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.999))
        let up = self.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.2))
        down.press(forDuration: 0.1, thenDragTo: up)
    }
}

Android

Preview
fun openNotifications() {
    val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
    device.executeShellCommand("input swipe 0 0 0 500")
}
Preview
fun openLaunchPad() {
    val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
    device.executeShellCommand("input swipe 0 500 0 0")
}

Updated: