@@ -292,8 +292,9 @@ def verify_install(
292292"""
293293 )
294294 elif sdk .cmdline_tools_path .parent .exists ():
295- # a cmdline-tools directory exists but the required version isn't installed.
296- # try to install the required version using the 'latest' version.
295+ # a cmdline-tools directory exists,
296+ # but the required version isn't installed.
297+ # Try to install the required version using the 'latest' version.
297298 if not sdk .install_cmdline_tools ():
298299 sdk = None
299300 tools .console .warning (
@@ -412,8 +413,10 @@ def install(self):
412413 # So, the unpacking process is:
413414 #
414415 # 1. Make a <sdk_path>/cmdline-tools folder
415- # 2. Unpack the zip file into that folder, creating <sdk_path>/cmdline-tools/cmdline-tools
416- # 3. Move <sdk_path>/cmdline-tools/cmdline-tools to <sdk_path>/cmdline-tools/<cmdline-tools version>
416+ # 2. Unpack the zip file into that folder, creating
417+ # <sdk_path>/cmdline-tools/cmdline-tools
418+ # 3. Move <sdk_path>/cmdline-tools/cmdline-tools to
419+ # <sdk_path>/cmdline-tools/<cmdline-tools version>
417420
418421 with self .tools .console .wait_bar (
419422 f"Installing Android SDK Command-Line Tools { self .SDK_MANAGER_VER } ..."
@@ -1474,9 +1477,10 @@ def run(self, *arguments: SubprocessArgT, quiet: int = 0) -> str:
14741477 [self .tools .android_sdk .adb_path , "-s" , self .device , * arguments ],
14751478 quiet = quiet ,
14761479 )
1477- # add returns status code 0 in the case of failure. The only tangible evidence
1478- # of failure is the message "Failure [INSTALL_FAILED_OLDER_SDK]" in the,
1479- # console output; so if that message exists in the output, raise an exception.
1480+ # add returns status code 0 in the case of failure.
1481+ # The only tangible evidence of failure is the message
1482+ # "Failure [INSTALL_FAILED_OLDER_SDK]" in the console output;
1483+ # so if that message exists in the output, raise an exception.
14801484 if "Failure [INSTALL_FAILED_OLDER_SDK]" in output :
14811485 raise BriefcaseCommandError (
14821486 "Your device doesn't meet the minimum SDK requirements of this app."
@@ -1529,9 +1533,9 @@ def start_app(self, package: str, activity: str, passthrough: list[str]):
15291533 :returns: `None` on success; raises an exception on failure.
15301534 """
15311535 try :
1532- # `am start` also accepts string array extras, but we pass the arguments as a
1533- # single JSON string, because JSON deals with edge cases like whitespace and
1534- # escaping in a reliable and well-documented way.
1536+ # `am start` also accepts string array extras, but we pass the arguments as
1537+ # a single JSON string, because JSON deals with edge cases like whitespace
1538+ # and escaping in a reliable and well-documented way.
15351539 output = self .run (
15361540 "shell" ,
15371541 "am" ,
@@ -1718,11 +1722,11 @@ def pidof(self, package: str, **kwargs) -> str | None:
17181722 :returns: The PID of the given app as a string, or None if it isn't
17191723 running.
17201724 """
1721- # The pidof command is available since API level 24. The level 23 emulator image also
1722- # includes it, but it doesn't work correctly (it returns all processes).
1725+ # The pidof command is available since API level 24. The level 23 emulator image
1726+ # also includes it, but it doesn't work correctly (it returns all processes).
17231727 try :
1724- # Exit status is unreliable: some devices (e.g. Nexus 4) return 0 even when no
1725- # process was found.
1728+ # Exit status is unreliable: some devices (e.g. Nexus 4) return 0
1729+ # even when no process was found.
17261730 return self .run ("shell" , "pidof" , "-s" , package , ** kwargs ).strip () or None
17271731 except subprocess .CalledProcessError :
17281732 return None
0 commit comments