From 66fda063c0e67dbf0b154f021f12d863efa618f9 Mon Sep 17 00:00:00 2001 From: dtopuzov Date: Mon, 18 Nov 2019 09:09:02 +0200 Subject: [PATCH 1/2] fix: cases when Xcode version is 3 digits --- core/utils/device/simctl.py | 6 ++++-- core/utils/version.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/utils/device/simctl.py b/core/utils/device/simctl.py index fad00289..b3d5f31e 100644 --- a/core/utils/device/simctl.py +++ b/core/utils/device/simctl.py @@ -9,6 +9,9 @@ # noinspection PyShadowingBuiltins +from core.utils.version import Version + + class Simctl(object): @staticmethod @@ -31,7 +34,6 @@ def __get_simulators(): def get_max_runtime_version(version): # Parse runtimes result = Simctl.run_simctl_command(command='list --json runtimes') - runtimes = None try: runtimes = json.loads(result.output) except ValueError: @@ -42,7 +44,7 @@ def get_max_runtime_version(version): exact_sdk_version = None for runtime in runtimes['runtimes']: if str(version) in runtime['version'] and runtime['name'].startswith('iOS') and runtime['isAvailable']: - exact_sdk_version = runtime['version'] + exact_sdk_version = Version.get(runtime['version']) if exact_sdk_version is None: raise Exception('Can not find iOS SDK {0}'.format(version)) diff --git a/core/utils/version.py b/core/utils/version.py index 331c689f..f1fdda05 100644 --- a/core/utils/version.py +++ b/core/utils/version.py @@ -8,6 +8,8 @@ class Version(object): def get(version): """ Convert version string to float. + Will also trim version like this: + - 13.2.2 will be trimmed to 13.2 :param version: Version string. :return: Version as float. """ From 89824910c14ce7c9fc26a72b302a5953aaa0d550 Mon Sep 17 00:00:00 2001 From: dtopuzov Date: Mon, 18 Nov 2019 09:11:14 +0200 Subject: [PATCH 2/2] chore: remove unused noinspection --- core/utils/device/simctl.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/utils/device/simctl.py b/core/utils/device/simctl.py index b3d5f31e..f99ea3ca 100644 --- a/core/utils/device/simctl.py +++ b/core/utils/device/simctl.py @@ -6,9 +6,6 @@ from core.utils.file_utils import File from core.utils.process import Process from core.utils.run import run - - -# noinspection PyShadowingBuiltins from core.utils.version import Version