appium / appium-idb

idb integration for Appium
Apache License 2.0
75 stars 13 forks source link

fix: describeDevice fails to parse a valid json #64

Closed rerorero closed 1 year ago

rerorero commented 1 year ago

This PR uses JSON.parse to parse a response of idb describe command since it returns a valid json now.

idb --companion 127.0.0.1:10882 describe --udid D965CF07-8E0D-4935-9393-BEFD79CA89D6 --json
{"udid": "D965CF07-8E0D-4935-9393-BEFD79CA89D6", "name": "appium-idb-tests-7E6E1674-DC49-4CEF-B990-0E15C27493F1", "target_type": "simulator", "state": "Booted", "os_version": "iOS 16.2", "architecture": "x86_64", "companion_info": {"udid": "D965CF07-8E0D-4935-9393-BEFD79CA89D6", "is_local": true, "pid": null, "address": {"host": "127.0.0.1", "port": 10882}, "metadata": {}}, "screen_dimensions": {"width": 1242, "height": 2688, "density": 3.0, "width_points": 414, "height_points": 896}, "model": null, "device": null, "extended": {}, "diagnostics": {}, "metadata": {}}

I just replaced fixOutputToObject with JSON.object but it breaks backward compatibility as it looks like that it's only used in tests https://github.com/search?q=org%3Aappium+target_description&type=code But please let me know if you need to keep it.

KazuCocoa commented 1 year ago

I was wondering if it would be nice to address the tested idb version as a requirement in https://github.com/appium/appium-idb#requirements , and bump the major version of this module since not sure when the JSON output got fixed.

rerorero commented 1 year ago

I added the version I tested to README https://github.com/appium/appium-idb/pull/64/commits/dc61888fd09dd92ff0a5403617a9213edad80f27 I will check the CI failures

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.6.8 :tada:

The release is available on:

Your semantic-release bot :package::rocket: