Skip to content

Commit 5619d35

Browse files
authored
fix: cases when iOS version is 3 digits (#437)
* fix: cases when Xcode version is 3 digits * chore: remove unused noinspection
1 parent 62f6429 commit 5619d35

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

core/utils/device/simctl.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from core.utils.file_utils import File
77
from core.utils.process import Process
88
from core.utils.run import run
9+
from core.utils.version import Version
910

1011

11-
# noinspection PyShadowingBuiltins
1212
class Simctl(object):
1313

1414
@staticmethod
@@ -31,7 +31,6 @@ def __get_simulators():
3131
def get_max_runtime_version(version):
3232
# Parse runtimes
3333
result = Simctl.run_simctl_command(command='list --json runtimes')
34-
runtimes = None
3534
try:
3635
runtimes = json.loads(result.output)
3736
except ValueError:
@@ -42,7 +41,7 @@ def get_max_runtime_version(version):
4241
exact_sdk_version = None
4342
for runtime in runtimes['runtimes']:
4443
if str(version) in runtime['version'] and runtime['name'].startswith('iOS') and runtime['isAvailable']:
45-
exact_sdk_version = runtime['version']
44+
exact_sdk_version = Version.get(runtime['version'])
4645
if exact_sdk_version is None:
4746
raise Exception('Can not find iOS SDK {0}'.format(version))
4847

core/utils/version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ class Version(object):
88
def get(version):
99
"""
1010
Convert version string to float.
11+
Will also trim version like this:
12+
- 13.2.2 will be trimmed to 13.2
1113
:param version: Version string.
1214
:return: Version as float.
1315
"""

0 commit comments

Comments
 (0)