appium-mac2-driver icon indicating copy to clipboard operation
appium-mac2-driver copied to clipboard

All wda mac interface sets

Open HaoWShi opened this issue 1 year ago • 6 comments

I would like to know where I can see all the current set of interfaces? anybody know?

HaoWShi avatar Feb 26 '24 13:02 HaoWShi

do you mean https://github.com/appium/appium-mac2-driver/blob/master/WebDriverAgentMac/WebDriverAgentLib/Commands/AMActionCommands.m for example? Then https://github.com/appium/appium-mac2-driver/tree/master/WebDriverAgentMac/WebDriverAgentLib/Commands

KazuCocoa avatar Feb 26 '24 17:02 KazuCocoa

I have read the files in https://github.com/appium/appium-mac2-driver/tree/master/WebDriverAgentMac/WebDriverAgentLib/Commands. In fact I mean https://github.com/appium/appium-mac2-driver/blob/master/lib/commands/app-management.js , there are interface I can use. The interface you mentioned, how should I use it?

HaoWShi avatar Feb 27 '24 06:02 HaoWShi

The WDA's APIs are expected to be used via mac2 driver running on a host machine, so https://github.com/appium/appium-mac2-driver/blob/master/lib/commands/app-management.js like you addresses are endpoints.

Each method names defined in JavaScript code are mapped in https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/routes.js . The Web API is defined in https://appium.io/docs/en/latest/commands/base-driver/ or https://appium.io/docs/en/latest/guides/execute-methods/ https://github.com/appium/appium-mac2-driver?tab=readme-ov-file#platform-specific-extensions

KazuCocoa avatar Feb 27 '24 07:02 KazuCocoa

Yes, It is what I want, I will read them firstly. Thank you very much By the way, I noticed the locked/unlock/lock interface on the phone, but on the Mac, I don't see it. Is it not supported? Or is it another interface?

HaoWShi avatar Feb 28 '24 01:02 HaoWShi

XCUITest driver achieves it with https://developer.apple.com/documentation/xctest/xcuidevice?language=objc but it looks like the documentation does not say macOS support it. So potentially macOS has no method to lock the screen over XCTest framework

KazuCocoa avatar Mar 01 '24 09:03 KazuCocoa

Instead, for lock, I wondered if Control-Command-Q: Immediately lock your screen. works https://support.apple.com/en-us/HT201236 https://github.com/appium/appium-mac2-driver?tab=readme-ov-file#macos-keys

KazuCocoa avatar Mar 01 '24 09:03 KazuCocoa