<!--
{
  "availability" : [
    "Xcode: 16.3.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "XCUIAutomation",
  "identifier" : "/documentation/XCUIAutomation/XCUILocation",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "XCUIAutomation"
    ],
    "preciseIdentifier" : "c:objc(cs)XCUILocation"
  },
  "title" : "XCUILocation"
}
-->

# XCUILocation

A proxy that simulates a device’s location in terms of its longitude, latitude, and course information.

```
@MainActor class XCUILocation
```

## Topics

### Creating a location

[`init(location: CLLocation)`](/documentation/XCUIAutomation/XCUILocation/init(location:))

Initializes a proxy that simulates latitude, longitude, and course information based on the location object you provide.

### Determining the location

[`var location: CLLocation`](/documentation/XCUIAutomation/XCUILocation/location)

Returns the object that contains the latitude, longitude, and course information this proxy simulates for the device.

[`var debugDescription: String`](/documentation/XCUIAutomation/XCUILocation/debugDescription)

A textual description of the location suitable for debugging.

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

---

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)