We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Centos7.9 python 3.7 nodejs 8系统运行提示:
File "/data/xxx/work/atxserver2-android-provider/device.py", line 155, in _install_apk self._device.install(path, force=True) TypeError: install() got an unexpected keyword argument 'force'
adbutils 0.9.1 def install(self, apk_path: str, force: bool = False): """ sdk = self.getprop('ro.build.version.sdk') sdk > 23 support -g
Args: force (bool): uninstall package before install Raises: AdbInstallError """ dst = "/data/local/tmp/tmp-{}.apk".format(int(time.time() * 1000)) self.sync.push(apk_path, dst) if force: apk = apkutils2.APK(apk_path) package_name = apk.manifest.package_name self.uninstall(package_name) self.install_remote(dst, clean=True)
adbutils 0.11.0 def install(self, path_or_url: str, nolaunch: bool = False, uninstall: bool = False, silent: bool = False, callback: typing.Callable[[str], None] = None): """ Install APK to device
Args: path_or_url: local path or http url nolaunch: do not launch app after install uninstall: uninstall app before install silent: disable log message print callback: only two event now: <"BEFORE_INSTALL" | "FINALLY"> Raises: AdbInstallError """ if re.match(r"^https?://", path_or_url): resp = requests.get(path_or_url, stream=True) resp.raise_for_status() length = int(resp.headers.get("Content-Length", 0)) r = ReadProgress(resp.raw, length) print("tmpfile path:", r.filepath()) else: length = os.stat(path_or_url).st_size fd = open(path_or_url, "rb") r = ReadProgress(fd, length, source_path=path_or_url)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Centos7.9 python 3.7 nodejs 8系统运行提示:
File "/data/xxx/work/atxserver2-android-provider/device.py", line 155, in _install_apk
self._device.install(path, force=True)
TypeError: install() got an unexpected keyword argument 'force'
requirements.txt文件adbutils版本
adbutils>=0.8.1,<1.0
解决思路:
1修改代码依赖高版本
def _install_apk(self, path: str):
assert path, "Invalid %s" % path
try:
m = apkutils.APK(path).manifest
info = self._device.package_info(m.package_name)
if info and m.version_code == info[
'version_code'] and m.version_name == info['version_name']:
logger.debug("%s already installed %s", self, path)
else:
print(info, ":", m.version_code, m.version_name)
logger.debug("%s install %s", self, path)
self._device.install(path, uninstall=True)
2.限制adbutils版本
adbutils 0.9.1
def install(self, apk_path: str, force: bool = False):
"""
sdk = self.getprop('ro.build.version.sdk')
sdk > 23 support -g
adbutils 0.11.0
def install(self,
path_or_url: str,
nolaunch: bool = False,
uninstall: bool = False,
silent: bool = False,
callback: typing.Callable[[str], None] = None):
"""
Install APK to device
The text was updated successfully, but these errors were encountered: