Unable to launch iOS Webdriver agent manually on iOS 17.X devices

When I build Webdriver agent on iOS Test devices (Physical and Simulator) that have iOS V17 or higher, I am not able to launch Webdriver agent on the devices manually.

When I click on the app it just launches with a black screen then closes. I tried multiple Physical devices and a Simulator and I have also made sure to restart the devices multiple times. Note that when building the SAME version from the SAME project on iOS 16.X devices, I am not facing this issue.

Has anyone faced this? any ideas what data I can get to help investigate the issue?

It is expected. WDA app not running as full UI app.

hmm, then we have to build WDA on iOS devices for every test or at least every run of automation?

Can I keep usePrebuiltWDA": true after building the app on device manually?

If I recall correctly when setting usePrebuiltWDA = false and running tests, appium keeps reinstalling WDA on every test, which greatly slows down test speed, any way I can change that behaviour?

Any reason it launches on iOS 16.X devices and not 17.X

Exactly. Doing the same.

Write your all caps.

e.g. mine when i do normal app start:

appium:fullReset: false
appium:noReset: true
appium:useNewWDA: false
appium:usePrebuiltWDA: true
1 Like

Nice, will try it.

Thank you so much for the quick replies.

I have the same black screen issue when I start it manually from the screen, but it works when I do the build from Xcode.

Unfortunately this is not a valid solution for my situation, I can probably use this when running tests, but NOT for Appium inspector.

The WDA inspector builds seems to be using the default Facebook signing settings and I cannot get access to that directory.

Issue is still there by the way I launch WDA it closes instantly WITHOUT setting up automation mode, so there is NO automation overlay for iOS 17.X devices.

Exactly, my issue.

Blank screen, then goes back to home, no Automation overlay appearing, Appium cannot connect to device and has to build Xcode again.

Thank you very much @Aleksei , this worked for the tests themselves, for Inspector, I will need to find a way to configure a separate WDA for it or try the reset flags again.

We can mark this thread as resolved from my side

WDA automation starts on iPhone immediately after building it from MacBook, but it stops unless the iPhone is connected to MacBook via USB or network. For iOS <17 I can just install WDA and disconnect it from MacBook. Any recommendations on how to keep automation running on iOS 17 without MacBook?
I install it with command:

xcodebuild build-for-testing test-without-building -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<UDID>' -allowProvisioningUpdates

(I am running Appium server on Ubuntu)

You may use the devicectl tool to launch WDA without Xcode. The bundle itself must be preprocessed properly in order to be able to do that. Read appium-xcuitest-driver/docs/guides/run-preinstalled-wda.md at master · appium/appium-xcuitest-driver · GitHub
and WebDriverAgent/lib/webdriveragent.js at 53bcaa87ba45dcda433daf23631e245139599413 · appium/WebDriverAgent · GitHub
for more details

Thank you for your reply, could you please explain it in more detail? I checked your resources but I am still not sure how to do it. I deleted Frameworks folder in the WDA bundle but do I still need to install the app with the command I provided before? Also do I need to include “prebuiltWDAPath” to the client even if I run it on Ubuntu? Doesn’t this path points to WDA on MacBook?

I found this discussion which was also quite helpful.

But I still get just the brief black screen even when I run the app with devicectl tool and automation does not start running.

1 Like

maybe @KazuCocoa has more context on this implementation. Unfortunately I cannot advice more myself

I think I figured it out.

  1. I went to the /Users/me/Library/Developer/Xcode/DerivedData/WebDriverAgent-…/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/Frameworks and removed every file that starts with XC.
  2. Secondly I installed the app with command:
    xcrun devicetl device install app --device <UDID> /Users/me/Library/Developer/Xcode/DerivedData/WebDriverAgent-.../Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
  3. Previous command failed because I didn’t yet trust the dev cert on the iPhone, so I built the WDA the standard way with xcodebuild.
  4. After trusting cert I repeated the 2. step.
  5. Then I ran the WDA with command:
    xcrun devicectl device process launch --device <UDID> --activate --environment-variables '{"USE_PORT":"8100"}' com.<wda_unique_name>.WebDriverAgentRunner.xctrunner

The automation ran even after I disconnected iPhone from MacBook, so it worked great. I got solution from @KazuCocoa on the discussion I linked above, also thank you @mykola-mokhnach.

1 Like

I followed every step you mentioned, and this really works for me, thank a lot.

1 Like

Hi, sorry I was unable to reply since I lost my credentials.

Thank you @mykola-mokhnach This worked beautifully.
Thank you @veno I can use these commands to make the process easier.

One Question though is this a restriction due to apple changes and we have to keep this workaround forever, os is there a possible fix, so we can just build and launch as before?

Ah ok ignore the first part of the question above I see the Attached Github issue explains why this issue is happening.

1 Like

Now I have a problem trying it installing to iPhone from Ubuntu. I tried using pymobiledevice3 with command:

python3 -m pymobiledevice3 apps install ./WebDriverAgentRunner-Runner.app

but it crashes when XC*.framework files are deleted. Error message:

pymobiledevice3.exceptions.AppInstallError: ApplicationVerificationFailed: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.iA9UIZ/extracted/Payload/WebDriverAgentRunner-Runner.app : 0xe8008017 (A signed resource has been added, modified, or deleted.)

Any help would be greatly appreciated.

pythonmobiledevice3 isn’t part of Appium.

There doesn’t seem to be a lot of support for pythonmobiledevice3 outside of filing a bug on the github repo. Best advice is that you do that:

1 Like