Skip to content

Commit

Permalink
Phrasing tweaks from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 authored Jul 23, 2023
1 parent 04706b7 commit 62949d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion changes/1157.bugfix.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Briefcase will now detect, if you try to launch an version on an android that is too old.
Briefcase will detect if you attempt to launch an Android app on a device whose OS doesn't meet minimum version requirements.
7 changes: 4 additions & 3 deletions src/briefcase/integrations/android_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,10 +1336,11 @@ def run(self, *arguments: SubprocessArgT, quiet: bool = False) -> str:
],
quiet=quiet,
)
# Manually raise error if "Failure [INSTALL_FAILED_OLDER_SDK]" occurs,
# because this failer results in return code 0
# add returns status code 0 in the case of failure. The only tangible evidence
# of failure is the message "Failure [INSTALL_FAILED_OLDER_SDK]" in the,
# console output; so if that message exists in the output, raise an exception.
if "Failure [INSTALL_FAILED_OLDER_SDK]" in output:
raise BriefcaseCommandError("Failed to install older SDK")
raise BriefcaseCommandError("Your device doesn't meet the minimum SDK requirements of this app.")
return output
except subprocess.CalledProcessError as e:
if any(DEVICE_NOT_FOUND.match(line) for line in e.output.split("\n")):
Expand Down
5 changes: 4 additions & 1 deletion tests/integrations/android_sdk/ADB/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,8 @@ def test_older_sdk_error(mock_tools, adb):
"Failure [INSTALL_FAILED_OLDER_SDK]",
]
)
with pytest.raises(BriefcaseCommandError):
with pytest.raises(
BriefcaseCommandError,
r"Your device doesn't meet the minimum SDK requirements of this app.",
):
adb.run("example", "command")

0 comments on commit 62949d9

Please sign in to comment.