diff --git a/core/utils/device/simctl.py b/core/utils/device/simctl.py index fad00289..f99ea3ca 100644 --- a/core/utils/device/simctl.py +++ b/core/utils/device/simctl.py @@ -6,9 +6,9 @@ from core.utils.file_utils import File from core.utils.process import Process from core.utils.run import run +from core.utils.version import Version -# noinspection PyShadowingBuiltins class Simctl(object): @staticmethod @@ -31,7 +31,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 +41,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. """