appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
35 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimulateLocationClient = void 0;
const appium_ios_device_1 = require("appium-ios-device");
class LegacySimulateLocationSession {
service;
constructor(service) {
this.service = service;
}
setLocation(latitude, longitude) {
this.service.setLocation(latitude, longitude);
}
resetLocation() {
this.service.resetLocation();
}
close() {
this.service.close();
}
}
/**
* Opens simulate-location sessions on the legacy `appium-ios-device` stack.
* Real devices on iOS 17 and newer use WebDriverAgent (`mobile:setSimulatedLocation` / related commands) instead.
*/
class SimulateLocationClient {
/**
* @param udid - Target device UDID
* @returns A session; {@link SimulateLocationSession#close | close()} when done.
*/
static async startSession(udid) {
const service = await appium_ios_device_1.services.startSimulateLocationService(udid);
return new LegacySimulateLocationSession(service);
}
}
exports.SimulateLocationClient = SimulateLocationClient;
//# sourceMappingURL=simulate-location-client.js.map