Appium UI inspector not working after xcode upgrade

UI inspector does not load after xcode upgrade on an iOS 15 real device.

Please find logs below:
[WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/58E3A011-8F89-45C6-B83F-15A045F3A0B0/screenshot] with no body
[WD Proxy] Got response with status 500: {“value”:{“error”:“unknown error”,“message”:"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x281ced580",“traceback”:"(\n\t0 CoreFoundation 0x00000001805e9cc0 FE94D75F-5F1D-3127-BA50-0161D8817EE6 + 597184\n\t1 libobjc.A.dylib 0x0000000197659758 objc_exception_throw + 56\n\t2 CoreFoundation 0x00000001806b96d0 FE94D75F-5F1D-3127-BA50-0161D8817EE6 + 1447632\n\t3 CoreFoundation 0x0000000180583edc FE94D75F-5F1D-3127-BA50-0161D8817EE6 + 179932\n\t4 CoreFoundation 0x000000018058314c _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000106ba0130 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 152\n\t6 WebDriverAgentLib 0x0000000106ba0010 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 76\n\t7 WebDriverAgentLib 0x0000000106b45254 +[FBScreenshotCommands handleGetScreenshot:] + 10…
[W3C] Matched W3C error code ‘unknown error’ to UnknownError
[XCUITest] Taking screenshot with WDA
[WD Proxy] Matched ‘/screenshot’ to command name ‘getScreenshot’
[WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/58E3A011-8F89-45C6-B83F-15A045F3A0B0/screenshot] with no body
[WD Proxy] Got response with status 500: {“value”:{“error”:“unknown error”,“message”:"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x281cea9c0",“traceback”:"(\n\t0 CoreFoundation 0x00000001805e9cc0 FE94D75F-5F1D-3127-BA50-0161D8817EE6 + 597184\n\t1 libobjc.A.dylib 0x0000000197659758 objc_exception_throw + 56\n\t2 CoreFoundation 0x00000001806b96d0 FE94D75F-5F1D-3127-BA50-0161D8817EE6 + 1447632\n\t3 CoreFoundation 0x0000000180583edc FE94D75F-5F1D-3127-BA50-0161D8817EE6 + 179932\n\t4 CoreFoundation 0x000000018058314c _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000106ba0130 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 152\n\t6 WebDriverAgentLib 0x0000000106ba0010 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 76\n\t7 WebDriverAgentLib 0x0000000106b45254 +[FBScreenshotCommands handleGetScreenshot:] + 10…
[W3C] Matched W3C error code ‘unknown error’ to UnknownError
[MJSONWP (b389f418)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x281cea9c0
[MJSONWP (b389f418)] at errorFromW3CJsonCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25)
[MJSONWP (b389f418)] at ProxyRequestError.getActualError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14)
[MJSONWP (b389f418)] at JWProxy.command (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:273:19)
[MJSONWP (b389f418)] at runMicrotasks ()
[MJSONWP (b389f418)] at processTicksAndRejections (internal/process/task_queues.js:85:5)
[HTTP] <-- GET /wd/hub/session/b389f418-c951-43aa-b430-354328852b5c/screenshot 500 1059 ms - 273
[HTTP]

You don’t list the version of inspector or xcode you are using. Probably just need to update inspector.

Hi Wreed,

I use Appium desktop with below specifications.

  • App Version: 1.20.2
  • Electron: 7.2.4
  • Node.js: 12.8.1

Xcode version - Version 13.2 (13C90)
When I check for updates, Appium says the application is upto date even though next versions are available.

Thanks,
Shruthi

Use Appium Server GUI 1.22 for Xcode 13:

Note that the inspector is now a separate download:

Start the server first and then start the inspector.

Hi Wreed,

Thank you for the suggestion .
But after starting session from inspector., it throws below error.

Please examine the link I had posted above:

Release notes state:

The version still expects to have /wd/hub prefix as Remote Path

Did you do that? It should be set in Inspector. I think that Appium 2.X won’t need that path.

Hi Wreed,

Thank you so much for all the help.
It works now.
But when I move around the pages it says below error.

Connection was refused to port 8100
[WD Proxy] socket hang up
[W3C (fd7221ee)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
[W3C (fd7221ee)] at JWProxy.command (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:274:13)
[W3C (fd7221ee)] at processTicksAndRejections (internal/process/task_queues.js:85:5)
[HTTP] <-- GET /wd/hub/session/fd7221ee-e3ff-4782-abd6-002c5220127b/source 500 8 ms - 641

Like it works only for first page on the app.Second one its errored out with socket hang up

Thanks again ,
Shruthi

Hi Shruthi,

I’m not familiar with this error. Is the app you are testing a Native iOS app, or is there something unusual about it (like ReactNative)?

I don’t know if you use the CLI for running your tests, but if you aren’t seeing this issue in CLI you should think about filing a bug here: https://github.com/appium/appium-desktop/issues

Of course I’m happy to continue here but this may be deeper than my experience.