openatx / facebook-wda

Facebook WebDriverAgent Python Client Library (not official)
MIT License
1.72k stars 266 forks source link

wda.exceptions.WDAUnknownError when taking screenshot #128

Open thlengane opened 1 year ago

thlengane commented 1 year ago

Bug

I am getting wda.exceptions.WDAUnknownError every time I execute d.screenshot('screen.png'.

Details:

See the execution below, this happens every time but tidevice screenshot screenshot.jpg works without any issues

Phone info:

PS C:\Users\Xzibit> tidevice info MarketName: iPhone 6 Plus DeviceName: Automation iPhone 1 ProductVersion: 12.5.7 ProductType: iPhone7,1 ModelNumber: MGAA2 SerialNumber:
PhoneNumber: None CPUArchitecture: arm64 ProductName: iPhone OS ProtocolVersion: 2 RegionInfo: AA/A TimeIntervalSince1970: 1676023012.348231 TimeZone: Africa/Johannesburg UniqueDeviceID: 19eed06cf80f471222e2893ed61350c4004019c1 WiFiAddress: e0:b5:2d:1b:ba:86 BluetoothAddress: e0:b5:2d:1b:ba:87 BasebandVersion: 7.80.04

facebook-wda : Version: 1.4.6 OS : Windows and Linux

Code and Logs:

$$$$ d.screenshot('screen.png')

Shell$ curl -X GET -d '' 'http+usbmux://19eed06cf80f471222e2893ed61350c4004019c1:8100/screenshot' Return (37ms): { "value" : { "error" : "unknown error", "message" : "-[XCUILocalDeviceScreenDataSource re... Traceback (most recent call last): File "", line 1, in File "C:\Python\lib\site-packages\wda__init.py", line 550, in screenshot value = self.http.get('screenshot').value File "C:\Python\lib\site-packages\wda\utils.py", line 47, in _inner return fn(*args, **kwargs) File "C:\Python\lib\site-packages\wda__init__.py", line 460, in _fetch response = httpdo(url, method, data, timeout) File "C:\Python\lib\site-packages\wda\init.py", line 130, in httpdo return _unsafe_httpdo(url, method, data, timeout) File "C:\Python\lib\site-packages\wda\init__.py", line 186, in _unsafe_httpdo raise errCls(status, value) wda.exceptions.WDAUnknownError: WDARequestError(status=110, value={'error': 'unknown error', 'message': '-[XCUILocalDeviceScreenDataSource requestScreenshotOfScreenWithID:withRect:scale:formatUTI:compressionQuality:withReply:]: unrecognized selector sent to instance 0x281de5780'})

tidevice syslog

PS C:\Users\Xzibit> tidevice syslog Feb 10 11:53:31 Automation-iPhone-1 mediaserverd(AppleTimeSyncAudioClock)[140] : gPTPClockStatistics for 0xe1b52d1bba860000 Feb 10 11:53:31 Automation-iPhone-1 mediaserverd(AppleTimeSyncAudioClock)[140] : Grandmaster Identity: 0xe1b52d1bba860000 Feb 10 11:53:31 Automation-iPhone-1 mediaserverd(AppleTimeSyncAudioClock)[140] : Clock lock state: Locked Feb 10 11:53:31 Automation-iPhone-1 mediaserverd(AppleTimeSyncAudioClock)[140] : Rate Ratio: 2199023255552/2199023255552 (1.000000000000) Feb 10 11:53:31 Automation-iPhone-1 mediaserverd(AppleTimeSyncAudioClock)[140] : Anchors: 1425987523, 59416146833 Feb 10 11:53:31 Automation-iPhone-1 mediaserverd(AppleTimeSyncAudioClock)[140] : Sync Identity: 0xe1b52d1bba860000.0 Feb 10 11:53:33 Automation-iPhone-1 mediaserverd(CoreMedia)[140] : <<<< TimeSyncClock >>>> figTimeSyncClock_Monitor: nowMonClock: 83699.737585; lastMonClock: 83689.725698; nowMonNet: 83699.738 (0xe1b52d1bba860000); lastMonNet: 83689.726 (0xe1b52d1bba860000); nowMonRef: 83699.738; lasMontRef: 83689.726; lastSynthAnchor: 83699.738; lastGM: 0xe1b52d1bba860000; offset 0.000; lastRefTimelineAnchor: 83699.738 Feb 10 11:53:34 Automation-iPhone-1 wifid[42] : WiFi:[697715614.747471]: WiFiDeviceManagerLQMEventCallback: null snrNumRef Feb 10 11:53:34 Automation-iPhone-1 symptomsd(SymptomEvaluator)[621] : L2 Metrics on ifname en0: rssi: -70 (txFrames/txReTx/txFail) 0/0/0 -> (was/is) 0/0 Feb 10 11:53:38 Automation-iPhone-1 WebDriverAgentRunner-Runner(CoreFoundation)[678] : -[XCUILocalDeviceScreenDataSource requestScreenshotOfScreenWithID:withRect:scale:formatUTI:compressionQuality:withReply:]: unrecognized selector sent to instance 0x281de5780 Feb 10 11:53:39 Automation-iPhone-1 wifid[42] : WiFi:[697715619.748567]: WiFiDeviceManagerLQMEventCallback: null snrNumRef Feb 10 11:53:39 Automation-iPhone-1 symptomsd(SymptomEvaluator)[621] : L2 Metrics on ifname en0: rssi: -70 (txFrames/txReTx/txFail) 0/0/0 -> (was/is) 0/0 Feb 10 11:53:42 Automation-iPhone-1 UserEventAgent(AppleHDQGasGauge)[22] : POSM disabled... Feb 10 11:53:42 Automation-iPhone-1 locationd[181] : {"msg":"adapter details", "adapterDescription":"usb charger", "batteryChargerType":"kChargerTypeUsb", "level":100} Feb 10 11:53:43 Automation-iPhone-1 mediaserverd(CoreMedia)[140] : <<<< TimeSyncClock >>>> figTimeSyncClock_Monitor: nowMonClock: 83709.748999; lastMonClock: 83699.737585; nowMonNet: 83709.749 (0xe1b52d1bba860000); lastMonNet: 83699.738 (0xe1b52d1bba860000); nowMonRef: 83709.749; lasMontRef: 83699.738; lastSynthAnchor: 83709.749; lastGM: 0xe1b52d1bba860000; offset 0.000; lastRefTimelineAnchor: 83709.749 Traceback (most recent call last): File "C:\Python\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Python\Scripts\tidevice.exe__main.py", line 7, in File "C:\Python\lib\site-packages\tidevice\main.py", line 972, in main actionsargs.subparser File "C:\Python\lib\site-packages\tidevice\main__.py", line 492, in cmd_syslog text = s.psock.recv().decode('utf-8') File "C:\Python\lib\site-packages\tidevice_safe_socket.py", line 108, in recv return self._sock.recv(bufsize) KeyboardInterrupt PS C:\Users\Xzibit>