# 安卓

  1. 首先保存上传的 apk 到临时目录
file_path = os.path.join(currentPath, '{}.apk'.format(unixtime))
if install.uploadFile(file_path, file):
    install_status = install.installAPK(file_path)
  1. 然后安装
def installAPK(self, path):
    result = adb.shell_noDevice(cmd='install -r {}'.format(path))
    if result == 0:
        os.remove(path)
        return True, result
    else:
        return False, result

# IOS

  1. 首先保存 ipa 包到临时目录
  2. 然后安装 (基于 tidevice)
def installIPA(self, path):
    result = Devices.execCmd('tidevice install {}'.format(path))
    if result == 0:
        os.remove(path)
        return True, result
    else:
        return False, result