Skip to content

fix: cases when iOS version is 3 digits #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions core/utils/device/simctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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))

Expand Down
2 changes: 2 additions & 0 deletions core/utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down