web driver agent 真機終於找到了一個非常好的配置方法!折磨了我好多天!

小哆啦發表於2020-10-23

原文地址

I had similar problems to yourself! Firstly I suggest reinstalling appium ("npm uninstall -g appium" and then "npm install -g appium@1.6.1" from the command line) to rule out any of your attempts to fix this issue actually causing more problems!

Then from a fresh install if you follow the steps below exactly that should be all that's be required to get up and running on a real device.

a. Firstly Go to the location of the WebDriverAgent package. Open a terminal window and navigate to directory by typing: cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

b. Whilst in the same directory enter the terminal command : mkdir -p Resources/WebDriverAgent.bundle

c. Then execute the command : sh ./Scripts/bootstrap.sh -d

d. Then execute the command Open WebDriverAgent.xcodeproj which will launch Xcode.

e. With the "General" view selected in Xcode change the bundle identifier string on WebDriverAgentLib & IntegrationApp (replace the "facebook" part with something unique). Then with the "Build Settings" view selected in Xcode click on the WebDriverAgentRunner and scroll down to the "packaging" section and change the bundle identifier there too (replace the "facebook" part with something unique). Now that you have all the bundle identifiers set correctly, choose the "General" view again in Xcode and - choose a dev signing account for each of the following WebDriverAgentLib, WebDriverAgentRunner and IntegrationApp

f. Start the appium server and try and run a test - it will automatically install the WebDriverAgent but it will fail the first time around as it can't launch the WebDriverAgent until the certificate for the app has been trusted on the device.

g. Before you try run again on the device, in iOS, go to Settings > General > Device Management and trust the certificate first

Try again after that and you should be all good!

PS

I made the assumption you were sending all the correct desired capabilities to the Appium Server
You will need to do this every time you upgrade or re-install appium

相關文章