appium-remote-debugger
Version:
Appium proxy for Remote Debugger protocol
79 lines • 3.11 kB
TypeScript
import { RpcClient } from './rpc-client';
import type { RemoteCommand, RpcClientOptions } from '../types';
import type { WebInspectorService, RemoteXpcConnection } from 'appium-ios-remotexpc';
/**
* Options specific to RpcClientRealDeviceShim.
*/
export interface RpcClientRealDeviceShimOptions extends RpcClientOptions {
/** The device UDID (required for shim connection) */
udid: string;
}
/**
* RPC client implementation for iOS 18+ real devices using the WebInspector shim.
* This client uses the `com.apple.webinspector.shim.remote` service via RemoteXPC
* tunneling, which is required for iOS 18 and later where the traditional
* Web Inspector service is no longer available.
*
* Extends RpcClient to provide device-specific connection handling using
* the appium-ios-remotexpc library.
*/
export declare class RpcClientRealDeviceShim extends RpcClient {
protected webInspectorService?: WebInspectorService;
protected remoteXPC?: RemoteXpcConnection;
protected messageListenerTask?: Promise<void>;
protected isListening: boolean;
/**
* Creates a new RpcClientRealDeviceShim instance.
*
* @param opts - Options for configuring the shim RPC client.
*/
constructor(opts: RpcClientRealDeviceShimOptions);
/**
* Connects to the WebInspector shim service on an iOS 18+ real device.
* Uses the RemoteXPC tunnel to establish a connection to the
* `com.apple.webinspector.shim.remote` service.
*/
connect(): Promise<void>;
/**
* Disconnects from the WebInspector shim service.
* Closes the service connection and cleans up resources.
*/
disconnect(): Promise<void>;
/**
* Sends a command message to the WebInspector shim service.
* Translates the RemoteCommand format to the shim service format.
*
* @param cmd - The command to send to the device.
*/
sendMessage(cmd: RemoteCommand): Promise<void>;
/**
* Receives data from the WebInspector shim service and handles it.
* This method is called by the message listener when a message is received.
*
* @param data - The data received from the service.
*/
receive(data: any): Promise<void>;
/**
* Starts the background message listener that receives messages from
* the WebInspector shim service and forwards them to the message handler.
*/
private startMessageListener;
/**
* Converts a message from the WebInspector shim format to the format
* expected by the message handler.
*
* @param message - The message from the shim service.
* @returns The converted message in the expected format.
*/
private convertMessage;
/**
* Translates command arguments from the RemoteCommand format to the
* format expected by the WebInspector shim service.
*
* @param args - The arguments from the RemoteCommand.
* @returns The translated arguments for the shim service.
*/
private translateArguments;
}
export default RpcClientRealDeviceShim;
//# sourceMappingURL=rpc-client-real-device-shim.d.ts.map