From 25c022d3b482034561729c8e350f93bb7b95fc34 Mon Sep 17 00:00:00 2001 From: yumiguan <41277086+yumiguan@users.noreply.github.com> Date: Fri, 13 Nov 2020 10:16:42 +0800 Subject: [PATCH] Feature/update-env-check (#38) * Update ideviceinstaller; Add iPhone13 modal * Update ideviceinstaller; Add iPhone13 modal * update version code * update env check * remove useless ideviceinstaller * solve conflict * remove useless exception * add IdeviceinstallerError * remove return warning_message * update code * remove useless code * remove png * update code * update traceback * add tempfile --- lyrebird_ios/bin/{ => 1.2.0}/ideviceinstaller | Bin lyrebird_ios/bin/1.3.0/ideviceinstaller | Bin 0 -> 45384 bytes .../config/comparison_table_model.json | 6 +- lyrebird_ios/device_service.py | 16 +-- lyrebird_ios/ios_helper.py | 101 ++++++++++++++---- setup.py | 2 +- 6 files changed, 97 insertions(+), 28 deletions(-) rename lyrebird_ios/bin/{ => 1.2.0}/ideviceinstaller (100%) create mode 100644 lyrebird_ios/bin/1.3.0/ideviceinstaller diff --git a/lyrebird_ios/bin/ideviceinstaller b/lyrebird_ios/bin/1.2.0/ideviceinstaller similarity index 100% rename from lyrebird_ios/bin/ideviceinstaller rename to lyrebird_ios/bin/1.2.0/ideviceinstaller diff --git a/lyrebird_ios/bin/1.3.0/ideviceinstaller b/lyrebird_ios/bin/1.3.0/ideviceinstaller new file mode 100644 index 0000000000000000000000000000000000000000..fe6725ead7f74c55a44ec8bae371ef6f4aecf1fa GIT binary patch literal 45384 zcmeHwdw5huw(m}$ks#QJqWC}?1O7?jCvGx22dH?O?)tpBB*2E-)~jzer&*V&R_St z_e;aBT5Hv+RjXF5dhFV@ci#B+vmcH#jJ$4!VdUdF3D+bLqJ|5QVVs7`jmztuQFdv? zH5D_blbZX>%SDfhQO+dQJyH~0UZH9 z;@Q6(U6J7RMj98_HTu1Ejq`(o=hk-(h_v54T>KHY%TOsQq@S3$yx#J%S!LcS)2Cgj zyaoOse$rQSYyU7bPXD!hm?W=vK`>*rW6K+(#nIoG-}G$utpvoG z@yJs-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z; z&xJJLYQ)7e5?s&Rh>PbfLb$@XBDi?IfoCL^;9837CS3o5YZ)%Cd2Ye=Gh8jWZpC#Q zu2x)axT3gj$8`s;<+x(F&cbyzE*Gx3xUR=_C$6sc`+uYTT!uI2=F6MDEAt-Z-p#A- z#k@7R?>XY83#6R8D(}(myu8_WaM)PFonX!`Q0DGOlW_}_-U3!T#eApUYkjUmA=Vw0 z_tG~|I01s%3dngfA`c{TDC${>kkn%m1f;x{`2fZ{Un>Je(hm!c`INwxko|ZdoutHC&ly-hc_5HZ=WbNalYn%J{SiRc4!^bc zpGDG}{zp)3yZu?|+1va_lBGd2&lEIs_Qw8^d8|}j=kx;!Tjn1Zee^y2?85Au_gQJy zu6-8CzFnV{WZS3DNl_d0S){D3@|>OdqqFF~moZ>gcG-(RdbT4r;j`E>yYJaVz3qOC z{q`ftX@ARXv}Z9LYll6XC1-2hwx@1wrf2P<+qciNaB&3et{;8FoQy}?DL-P1oFgco zGZ?%6@n@XJf$H2+yWw?|^H%>KYyUwJ@cC!LBuWT@r!ky);EoA}qUb2EYPQ%slQ9#89 zyZO+%+=Uji@QHE;%i1r_A*zjHA!Y9n3qj2UxgS|lBK00IHiLyRXBYU0Qv%jx-pndn zpMjEzDk5J^ku;k54uj>3QIYSsx9Xen^+*QctkckCVJ! Z(Gmg|aX;KEU;ASR2^I1II039<{|`RK-+BN5 literal 0 HcmV?d00001 diff --git a/lyrebird_ios/config/comparison_table_model.json b/lyrebird_ios/config/comparison_table_model.json index d159099..c72f79f 100644 --- a/lyrebird_ios/config/comparison_table_model.json +++ b/lyrebird_ios/config/comparison_table_model.json @@ -31,5 +31,9 @@ "iPhone11,8": "iPhone XR", "iPhone12,1": "iPhone 11", "iPhone12,3": "iPhone 11 Pro", - "iPhone12,5": "iPhone 11 Pro Max" + "iPhone12,5": "iPhone 11 Pro Max", + "iPhone13,1": "iPhone 12 mini", + "iPhone13,2": "iPhone 12", + "iPhone13,3": "iPhone 12 Pro", + "iPhone13,4": "iPhone 12 Pro Max" } diff --git a/lyrebird_ios/device_service.py b/lyrebird_ios/device_service.py index 4ee4e92..6d6743d 100644 --- a/lyrebird_ios/device_service.py +++ b/lyrebird_ios/device_service.py @@ -1,6 +1,7 @@ import os import shutil import lyrebird +import traceback from . import ios_helper from lyrebird import context from lyrebird.log import get_logger @@ -23,14 +24,13 @@ def __init__(self): self.reset_screenshot_dir() def check_env(self): - error_message = ios_helper.check_environment() - if not error_message: + try: + ios_helper.check_environment() self.status = self.RUNNING _log.debug('iOS device listener start') - else: + except Exception: self.status = self.STOP - _log.error(error_message) - return error_message + _log.error(f'iOS plugin stoped!\n {traceback.format_exc()}') def devices_to_dict(self): json_obj = {} @@ -44,8 +44,8 @@ def run(self): try: self.handle() context.application.socket_io.sleep(self.handle_interval) - except Exception as e: - _log.error(e) + except Exception: + _log.error(f'iOS plugin error!\n {traceback.format_exc()}') self.status = self.STOP def handle(self): @@ -89,7 +89,7 @@ def publish_devices_info_event(online_devices, app_name): 'packageName': app_info['BundleID'] } except Exception: - _log.error('Can\'t read app info') + _log.error(f'Read app info error!\n {traceback.format_exc()}') lyrebird.publish('ios.device', devices, state=True) diff --git a/lyrebird_ios/ios_helper.py b/lyrebird_ios/ios_helper.py index b1e4d81..5026792 100644 --- a/lyrebird_ios/ios_helper.py +++ b/lyrebird_ios/ios_helper.py @@ -3,15 +3,17 @@ import time import codecs import plistlib +import tempfile import subprocess +from pathlib import Path +from packaging import version import lyrebird from lyrebird.log import get_logger from . import wda_helper -from pathlib import Path _log = get_logger() -ideviceinstaller = Path(__file__).parent/'bin'/'ideviceinstaller' +ideviceinstaller = None idevice_id = None idevicescreenshot = None ideviceinfo = None @@ -22,6 +24,7 @@ screenshot_dir = os.path.abspath(os.path.join(storage, 'screenshot')) PLIST_PATH = os.path.join(storage, 'plist') +SYSTEM_BIN = Path('/usr/local/bin') ios_driver = wda_helper.Helper() @@ -30,22 +33,66 @@ def check_environment(): 检查用户环境,第三方依赖是否正确安装。 :return: """ - global idevice_id, idevicescreenshot, ideviceinfo - - if not os.path.exists('/usr/local/bin/ideviceinfo'): - return 'ideviceinfo command not found, check your libimobiledevice' - else: - p = subprocess.Popen('/usr/local/bin/ideviceinfo', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - err = p.stderr.read().decode() - if len(err): - return f'Something wrong with the ideviceinfo program: {err}' - - if not os.path.exists('/usr/local/bin/idevicescreenshot'): - return 'ideviceinfo command not found, check your libimobiledevice' - - idevice_id = '/usr/local/bin/idevice_id' - ideviceinfo = '/usr/local/bin/ideviceinfo' - idevicescreenshot = '/usr/local/bin/idevicescreenshot' + global ideviceinstaller, idevice_id, idevicescreenshot, ideviceinfo + + # Check libmobiledevice, action when unavailable : block + p = subprocess.run('brew info --json libimobiledevice', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + code, output, err_str = p.returncode, p.stdout.decode(), p.stderr.decode() + if err_str or code or not output: + raise LibmobiledeviceError(f'Get libmobiledevice info error: {err_str}') + + libimobiledevice_info = json.loads(output) + if not isinstance(libimobiledevice_info, list) and not len(libimobiledevice_info): + raise LibmobiledeviceError(f'Get unknown libmobiledevice info: {output}') + + # Check idevice_id, action when unavailable : block + idevice_id_keywords = 'idevice_id' + idevice_id = SYSTEM_BIN/idevice_id_keywords + err_msg = check_environment_item(idevice_id_keywords, idevice_id) + if err_msg: + idevice_id = None + raise IdeviceidError(err_msg) + + # Check ideviceinfo, action when unavailable : block + ideviceinfo_keywords = 'ideviceinfo' + ideviceinfo = SYSTEM_BIN/ideviceinfo_keywords + err_msg = check_environment_item(ideviceinfo_keywords, ideviceinfo) + if err_msg: + ideviceinfo = None + raise IdeviceinfoError(err_msg) + + env_err_msg = [] + + # Check ideviceinstaller, action when unavailable : warning + lib_version = libimobiledevice_info[0].get('versions', {}).get('stable') + lib_version = '1.2.0' if version.parse(lib_version) < version.parse('1.3.0') else '1.3.0' + + ideviceinstaller_keywords = 'ideviceinstaller' + ideviceinstaller = Path(__file__).parent/'bin'/lib_version/ideviceinstaller_keywords + err_msg = check_environment_item(ideviceinstaller_keywords, ideviceinstaller) + if err_msg: + env_err_msg.append(err_msg) + ideviceinstaller = None + + # Check idevicescreenshot, action when unavailable : warning + idevicescreenshot_keywords = 'idevicescreenshot' + idevicescreenshot = SYSTEM_BIN/idevicescreenshot_keywords + temp_file = tempfile.NamedTemporaryFile().name + err_msg = check_environment_item(idevicescreenshot_keywords, idevicescreenshot, sub_command=temp_file) + if err_msg: + env_err_msg.append(err_msg) + idevicescreenshot = None + + if env_err_msg: + _log.error('iOS Plugin environment warning:\n' + '.\n'.join(env_err_msg)) + +def check_environment_item(command, path, sub_command=''): + if not Path(path).exists(): + return f'Command `{command}` not found, check your libimobiledevice' + + p = subprocess.run(f'{str(path)} {sub_command}', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + err_str = p.stderr.decode() + return f'Execute command `{command}` error: {err_str}' if err_str else '' def read_plist(plist_path): return plistlib.readPlist(plist_path) @@ -217,6 +264,8 @@ def get_device_plist(self, device_id): plist_path = '%s/%s.plist' % (PLIST_PATH, self.device_id) if not os.path.exists(PLIST_PATH): os.mkdir(PLIST_PATH) + if not ideviceinstaller: + raise IdeviceinstallerError('Command `ideviceinstaller` is not ready! Check your libimobiledevice') _cmd = f'{ideviceinstaller} -u {self.device_id} -l -o xml > {plist_path}' p = subprocess.Popen(_cmd, shell=True) p.wait() @@ -280,3 +329,19 @@ def devices(): online_devices[device.device_id] = device return online_devices + + +class LibmobiledeviceError(Exception): + pass + + +class IdeviceinstallerError(Exception): + pass + + +class IdeviceidError(Exception): + pass + + +class IdeviceinfoError(Exception): + pass diff --git a/setup.py b/setup.py index 74f60fc..f9b42a0 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='lyrebird-ios', - version='0.3.2', + version='0.3.3', packages=['lyrebird_ios'], url='https://github.com/meituan/lyrebird-ios', author='HBQA',