appium / WebDriverAgent

A WebDriver server for iOS and tvOS
Other
1.2k stars 377 forks source link

Can't manually run WebDriverAgentRunner #826

Closed PBartolM closed 10 months ago

PBartolM commented 10 months ago

I've recently updated to ios OS 17.2, and now when i build and install a WebDriverAgentRunner, i can't make it run on my device manually, despite it running when i select the Test / Test without building / Build for testing. I used to be able to do this without any issue, but now the app opens closes and i can't run xcuitest automation. i need a way to run/launch WebDriverAgentRunner without connection to Xcode, from the iphone itself because i use a mandatory vpn and now it's not finding iphones when either has a VPN. more info xcode 15.1 webdriver version: 5.15.4 iphone 13 iOS 17.2 (21C62)

KazuCocoa commented 10 months ago

Does "manually" mean like https://appium.github.io/appium-xcuitest-driver/5.12/run-preinstalled-wda/ ? Or with xcodebuild?

PBartolM commented 10 months ago

i mean, like the app icon is on the home screen, press it, and see the automation running thing.

KazuCocoa commented 10 months ago

Then, it looks like the behavior changed in iOS 17. I don't recall in the past, but I guess lower iOS versions could launch by tapping the icon. At least it is not by WDA, I guess it is XCTest process related by iOS.

HaoWShi commented 7 months ago

i mean, like the app icon is on the home screen, press it, and see the automation running thing.

did you achieve it? by tap icon of wda to launch it ?

HaoWShi commented 7 months ago

Fortunately, I found a way to launch WDA on IOS by clicking on the icon after installing WDA. Refer to the following links: https://blog.csdn.net/boildoctor/article/details/123588999 https://zhuanlan.zhihu.com/p/673319266

1)deploy wda to IOS by xcode, trust the phone device 2)Build wda by xcode, and remember the output path of build. 3)do ` $ xcodebuild build-for-testing -scheme WebDriverAgentRunner -sdk iphoneos -configuration Release -derivedDataPath /tmp/derivedDataPath $ cd /tmp/derivedDataPath $ cd Build/Products/Release-iphoneos # path might be different

Created folder Payload and put .app into it then compressed to zip, change extention name to .ipa. That's all. $ mkdir Payload && cp -r *.app Payload ` 4) delete XC** folder in WebDriverAgentRunner-Runner.app/Frameworks 5) Reconstructing Signature Information Refer the https://blog.csdn.net/boildoctor/article/details/123588999 I use the '方法2', Finally, a message indicating that the signature is being replaced is obtained. 6) use 'zip -r WDA.ipa Payload' to deploy wda, and install WDA.ipa to iphone

After the preceding steps are performed, you can directly click the wda icon on the mobile phone to start the wda.

PBartolM commented 6 months ago

Solution found, didn't see comment above and it's slightly different so i'm writting it here (This is for Real Device ios 17) 1- Download at least webdriver version 8.5.1 2- Open it on XCode, 3- Sign framework and WebDriverAgentRunner with a valid certificate 4- Build WebDriverAgentRunner on your phone 5- Open the build folder, go to products > debug-iphoneios 6- right click app, Show package contents > go to Framework folder 7- inside delete all folders that start with XC 8- Install app by opening xcode devices windows and then dragging the app from the build folder 9- if it's for automated testing like mine was, on capabilities write appium: usePreinstalledWDA: 'true' Done, now you can tap the test app and it begins automation. Works for running tests with VPN on.