appium / appium-xcuitest-driver

Appium iOS driver, backed by Apple XCTest
https://appium.github.io/appium-xcuitest-driver/
Apache License 2.0
740 stars 416 forks source link

Is there has any way to run js thread in real device app context? #2448

Open wabicai opened 1 month ago

wabicai commented 1 month ago

I want to get cllipboard from iOS real device. But in https://developer.apple.com/forums/thread/706761 show that i don't have permission to get clipboard when appium is running background.

So i try to provide a method in my app, for getting clipboard context. Just like $backgroundApi.serviceE2E.getClipboard();

I try this in appium, but it does's work. Showing error log with "Method is not implemented"

browser.execute(async done => {
      const data = $backgroundApi.serviceE2E.getClipboard();
      done(data);
    });
wabicai commented 1 month ago

https://appium.github.io/appium-xcuitest-driver/latest/guides/clipboard/ In the official documentation, it shows that I need to switch the active application. But unfortunately, I can't. Because it will refresh my app. That's not what I want to see