<!--
{
  "availability" : [
    "Xcode: 16.3.0 -",
    "tvOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "XCUIAutomation",
  "identifier" : "/documentation/XCUIAutomation/XCUIRemote/press(_:forDuration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XCUIAutomation"
    ],
    "preciseIdentifier" : "c:objc(cs)XCUIRemote(im)pressButton:forDuration:"
  },
  "title" : "press(_:forDuration:)"
}
-->

# press(_:forDuration:)

Sends a press and hold of a button on a physical remote control, holding for the specified duration.

```
func press(_ remoteButton: XCUIRemote.Button, forDuration duration: TimeInterval)
```

## Parameters

`remoteButton`

The button on the physical remote control that you want to press and hold.

`duration`

The duration of the button press and hold in seconds.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)