当前位置: 首页>>代码示例>>Python>>正文


Python AdbWrapper.check_adb方法代码示例

本文整理汇总了Python中util.adb_helper.AdbWrapper.check_adb方法的典型用法代码示例。如果您正苦于以下问题:Python AdbWrapper.check_adb方法的具体用法?Python AdbWrapper.check_adb怎么用?Python AdbWrapper.check_adb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util.adb_helper.AdbWrapper的用法示例。


在下文中一共展示了AdbWrapper.check_adb方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
 def __init__(self, **kwargs):
     self.arg_parser = argparse.ArgumentParser(description='Enable Certified Apps Debugging.',
                                               formatter_class=RawTextHelpFormatter,
                                               epilog=textwrap.dedent('''\
                                               Please enable "ADB and Devtools" of device.
                                               Ref:
                                               - https://developer.mozilla.org/en-US/docs/Tools/WebIDE
                                               - https://developer.mozilla.org/en-US/docs/Tools/WebIDE/Running_and_debugging_apps#Debugging_apps
                                               '''))
     self.arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None,
                                  help=textwrap.dedent('''\
                                  Directs command to the device or emulator with the
                                  given serial number. Overrides ANDROID_SERIAL
                                  environment variable. (default: %(default)s)
                                  '''))
     self.arg_parser.add_argument('--disable', action='store_true', dest='disable', default=False, help='Disable the privileges. (default: %(default)s)')
     self.arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False,
                                  help=textwrap.dedent('''\
                                  Turn on verbose output, with all the debug logger.
                                  (default: %(default)s)
                                  '''))
     self.args = self.arg_parser.parse_args()
     # setup the logging config
     if self.args.verbose is True:
         verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
         logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
     else:
         formatter = '%(levelname)s: %(message)s'
         logging.basicConfig(level=logging.INFO, format=formatter)
     AdbWrapper.check_adb()
开发者ID:Conjuror,项目名称:b2g-util-python,代码行数:32,代码来源:enable_certapps_devtools.py

示例2: __init__

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
    def __init__(self, **kwargs):
        self._FILE_PROFILE_INI = 'profiles.ini'
        self._FILE_COMPATIBILITY_INI = 'compatibility.ini'
        self._LOCAL_DIR_SDCARD = 'sdcard'
        self._LOCAL_DIR_WIFI = 'wifi'
        self._LOCAL_FILE_WIFI = 'wifi/wpa_supplicant.conf'
        self._LOCAL_DIR_B2G = 'b2g-mozilla'
        self._LOCAL_DIR_DATA = 'data-local'
        self._LOCAL_DIR_DATA_APPS = 'webapps'
        self._REMOTE_DIR_SDCARD = '/sdcard/'
        self._REMOTE_FILE_WIFI = '/data/misc/wifi/wpa_supplicant.conf'
        self._REMOTE_FILE_WIFI_OWNER = 'system:wifi'
        self._REMOTE_DIR_B2G = '/data/b2g/mozilla'
        self._REMOTE_DIR_DATA = '/data/local'

        self.arg_parser = argparse.ArgumentParser(description='Workaround for backing up and restoring Firefox OS profiles. (BETA)',
                                                  formatter_class=ArgumentDefaultsHelpFormatter)
        self.arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None, help='Directs command to the device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.')
        br_group = self.arg_parser.add_mutually_exclusive_group(required=True)
        br_group.add_argument('-b', '--backup', action='store_true', dest='backup', default=False, help='Backup user profile.')
        br_group.add_argument('-r', '--restore', action='store_true', dest='restore', default=False, help='Restore user profile.')
        self.arg_parser.add_argument('--sdcard', action='store_true', dest='sdcard', default=False, help='Also backup/restore SD card.')
        self.arg_parser.add_argument('--no-reboot', action='store_true', dest='no_reboot', default=False, help='Do not reboot B2G after backup/restore.')
        self.arg_parser.add_argument('-p', '--profile-dir', action='store', dest='profile_dir', default='mozilla-profile', help='Specify the profile folder.')
        self.arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False, help='Turn on verbose output, with all the debug logger.')
        self.args = self.arg_parser.parse_args()
        # setup the logging config
        if self.args.verbose is True:
            verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
            logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
        else:
            formatter = '%(levelname)s: %(message)s'
            logging.basicConfig(level=logging.INFO, format=formatter)
        AdbWrapper.check_adb()
开发者ID:Conjuror,项目名称:b2g-util-python,代码行数:36,代码来源:backup_restore_profile.py

示例3: cli

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
    def cli(self):
        """
        Handle the argument parse, and the return the instance itself.
        """
        # argument parser
        arg_parser = argparse.ArgumentParser(description='Reset Firefox OS Phone.',
                                             formatter_class=ArgumentDefaultsHelpFormatter)
        arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None,
                                help='Directs command to the device or emulator with the given serial number.'
                                     'Overrides ANDROID_SERIAL environment variable.')
        arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False,
                                help='Turn on verbose output, with all the debug logger.')

        # parse args and setup the logging
        args = arg_parser.parse_args()
        # setup the logging config
        if args.verbose is True:
            verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
            logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
        else:
            formatter = '%(levelname)s: %(message)s'
            logging.basicConfig(level=logging.INFO, format=formatter)
        # check ADB
        AdbWrapper.check_adb()
        # assign the variable
        self.set_serial(args.serial)
        # return instance
        return self
开发者ID:zapion,项目名称:b2g-util-python,代码行数:30,代码来源:reset_phone.py

示例4: cli

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
    def cli(self):
        """
        Handle the argument parse, and the return the instance itself.
        """
        # argument parser
        arg_parser = argparse.ArgumentParser(description='Check the version information of Firefox OS.',
                                             formatter_class=ArgumentDefaultsHelpFormatter)
        arg_parser.add_argument('--no-color', action='store_true', dest='no_color', default=False,
                                help='Do not print with color. NO_COLOR will overrides this option.')
        arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None,
                                help='Directs command to the device or emulator with the given serial number. '
                                     'Overrides ANDROID_SERIAL environment variable.')
        arg_parser.add_argument('--log-text', action='store', dest='log_text', default=None, help='Text ouput.')
        arg_parser.add_argument('--log-json', action='store', dest='log_json', default=None, help='JSON output.')
        arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False,
                                help='Turn on verbose output, with all the debug logger.')

        # parse args and setup the logging
        args = arg_parser.parse_args()
        # setup the logging config
        if args.verbose is True:
            verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
            logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
        else:
            formatter = '%(levelname)s: %(message)s'
            logging.basicConfig(level=logging.INFO, format=formatter)
        # check ADB
        AdbWrapper.check_adb()
        # assign variable
        self.set_no_color(args.no_color)
        self.set_serial(args.serial)
        self.set_log_text(args.log_text)
        self.set_log_json(args.log_json)
        # return instance
        return self
开发者ID:zapion,项目名称:b2g-util-python,代码行数:37,代码来源:check_versions.py

示例5: prepare

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
 def prepare(self):
     """
     parse args and setup the logging
     """
     self.args = self.arg_parser.parse_args()
     # setup the logging config
     if self.args.verbose is True:
         verbose_formatter = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
         logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
     else:
         formatter = "%(levelname)s: %(message)s"
         logging.basicConfig(level=logging.INFO, format=formatter)
     AdbWrapper.check_adb()
开发者ID:ShakoHo,项目名称:b2g-util-python,代码行数:15,代码来源:check_versions.py

示例6: __init__

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
 def __init__(self, **kwargs):
     self.arg_parser = argparse.ArgumentParser(description='Get the Crash Reports from Firefox OS Phone.',
                                               formatter_class=ArgumentDefaultsHelpFormatter)
     self.arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None, help='Directs command to the device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.')
     self.arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False, help='Turn on verbose output, with all the debug logger.')
     self.args = self.arg_parser.parse_args()
     # setup the logging config
     if self.args.verbose is True:
         verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
         logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
     else:
         formatter = '%(levelname)s: %(message)s'
         logging.basicConfig(level=logging.INFO, format=formatter)
     AdbWrapper.check_adb()
开发者ID:Conjuror,项目名称:b2g-util-python,代码行数:16,代码来源:get_crashreports.py

示例7: cli

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
    def cli(self):
        """
        Handle the argument parse, and the return the instance itself.
        """
        # argument parser
        arg_parser = argparse.ArgumentParser(
            description='Workaround for backing up and restoring Firefox OS profiles. (BETA)',
            formatter_class=ArgumentDefaultsHelpFormatter)
        arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None,
                                help='Directs command to the device or emulator with the given serial number. '
                                     'Overrides ANDROID_SERIAL environment variable.')
        br_group = arg_parser.add_mutually_exclusive_group(required=True)
        br_group.add_argument('-b', '--backup', action='store_true', dest='backup', default=False,
                              help='Backup user profile.')
        br_group.add_argument('-r', '--restore', action='store_true', dest='restore', default=False,
                              help='Restore user profile.')
        arg_parser.add_argument('--sdcard', action='store_true', dest='sdcard', default=False,
                                help='Also backup/restore SD card.')
        arg_parser.add_argument('--no-reboot', action='store_true', dest='no_reboot', default=False,
                                help='Do not reboot B2G after backup/restore.')
        arg_parser.add_argument('-p', '--profile-dir', action='store', dest='profile_dir', default='mozilla-profile',
                                help='Specify the profile folder.')
        arg_parser.add_argument('--skip-version-check', action='store_true', dest='skip_version_check', default=False,
                                help='Turn off version check between backup profile and device.')
        arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False,
                                help='Turn on verbose output, with all the debug logger.')

        # parse args and setup the logging
        args = arg_parser.parse_args()
        # setup the logging config
        if args.verbose is True:
            verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
            logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
        else:
            formatter = '%(levelname)s: %(message)s'
            logging.basicConfig(level=logging.INFO, format=formatter)
        # check ADB
        AdbWrapper.check_adb()
        # assign the variable
        self.set_serial(args.serial)
        if args.backup:
            self.set_backup(args.backup)
        elif args.restore:
            self.set_restore(args.restore)
        self.set_sdcard(args.sdcard)
        self.set_no_reboot(args.no_reboot)
        self.set_profile_dir(args.profile_dir)
        self.set_skip_version_check(args.skip_version_check)
        # return instance
        return self
开发者ID:zapion,项目名称:b2g-util-python,代码行数:52,代码来源:backup_restore_profile.py

示例8: __init__

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
 def __init__(self, **kwargs):
     self.arg_parser = argparse.ArgumentParser(description='Check the version information of Firefox OS.',
                                               formatter_class=ArgumentDefaultsHelpFormatter)
     self.arg_parser.add_argument('--no-color', action='store_true', dest='no_color', default=False, help='Do not print with color. NO_COLOR will overrides this option.')
     self.arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None, help='Directs command to the device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.')
     self.arg_parser.add_argument('--log-text', action='store', dest='log_text', default=None, help='Text ouput.')
     self.arg_parser.add_argument('--log-json', action='store', dest='log_json', default=None, help='JSON output.')
     self.arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False, help='Turn on verbose output, with all the debug logger.')
     self.args = self.arg_parser.parse_args()
     # setup the logging config
     if self.args.verbose is True:
         verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
         logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
     else:
         formatter = '%(levelname)s: %(message)s'
         logging.basicConfig(level=logging.INFO, format=formatter)
     AdbWrapper.check_adb()
开发者ID:Conjuror,项目名称:b2g-util-python,代码行数:19,代码来源:check_versions.py

示例9: cli

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
    def cli(self):
        """
        Handle the argument parse, and the return the instance itself.
        """
        # argument parser
        arg_parser = argparse.ArgumentParser(
            description='Workaround for shallow flash Gaia or Gecko into device.',
            formatter_class=ArgumentDefaultsHelpFormatter)
        arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None,
                                help='Directs command to the device or emulator with the given serial number. '
                                     'Overrides ANDROID_SERIAL environment variable.')
        arg_parser.add_argument('-g', '--gaia', action='store', dest='gaia', default=None,
                                help='Specify the Gaia package. (zip format)')
        arg_parser.add_argument('-G', '--gecko', action='store', dest='gecko', default=None,
                                help='Specify the Gecko package. (tar.gz format)')
        arg_parser.add_argument('--keep-profile', action='store_true', dest='keep_profile', default=False,
                                help='Keep user profile of device. Only work with shallow flash Gaia. (BETA)')
        arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False,
                                help='Turn on verbose output, with all the debug logger.')

        # parse args and setup the logging
        args = arg_parser.parse_args()
        # setup the logging config
        if args.verbose is True:
            verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
            logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
        else:
            formatter = '%(levelname)s: %(message)s'
            logging.basicConfig(level=logging.INFO, format=formatter)
        # check ADB
        AdbWrapper.check_adb()
        # assign the variable
        self.set_serial(args.serial)
        if args.gaia:
            if self._is_gaia_package(args.gaia):
                self.set_gaia(args.gaia)
        if args.gecko:
            if self._is_gecko_package(args.gecko):
                self.set_gecko(args.gecko)
        self.set_keep_profile(args.keep_profile)
        # return instance
        return self
开发者ID:zapion,项目名称:b2g-util-python,代码行数:44,代码来源:shallow_flash.py

示例10: cli

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
 def cli(self):
     """
     Handle the argument parse, and the return the instance itself.
     """
     # argument parser
     arg_parser = argparse.ArgumentParser(description='Enable/disable Certified Apps Debugging.',
                                          formatter_class=RawTextHelpFormatter,
                                          epilog=textwrap.dedent("""\
                                               Please enable "ADB and Devtools" of device.
                                               Ref:
                                               - https://developer.mozilla.org/en-US/docs/Tools/WebIDE
                                               - https://developer.mozilla.org/en-US/docs/Tools/WebIDE/Running_and_debugging_apps#Debugging_apps
                                               """))
     arg_parser.add_argument('-s', '--serial', action='store', dest='serial', default=None,
                             help=textwrap.dedent("""\
                                  Directs command to the device or emulator with the
                                  given serial number. Overrides ANDROID_SERIAL
                                  environment variable. (default: %(default)s)
                                  """))
     arg_parser.add_argument('--disable', action='store_true', dest='disable', default=False,
                             help='Disable the privileges. (default: %(default)s)')
     arg_parser.add_argument('-v', '--verbose', action='store_true', dest='verbose', default=False,
                             help=textwrap.dedent("""\
                                  Turn on verbose output, with all the debug logger.
                                  (default: %(default)s)
                                  """))
     # parse args and setup the logging
     args = arg_parser.parse_args()
     # setup the logging config
     if args.verbose is True:
         verbose_formatter = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
         logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
     else:
         formatter = '%(levelname)s: %(message)s'
         logging.basicConfig(level=logging.INFO, format=formatter)
     # check ADB
     AdbWrapper.check_adb()
     # assign variable
     self.set_serial(args.serial)
     self.set_disable(args.disable)
     # return instance
     return self
开发者ID:zapion,项目名称:b2g-util-python,代码行数:44,代码来源:enable_certapps_devtools.py

示例11: cli

# 需要导入模块: from util.adb_helper import AdbWrapper [as 别名]
# 或者: from util.adb_helper.AdbWrapper import check_adb [as 别名]
    def cli(self):
        """
        Handle the argument parse, and the return the instance itself.
        """
        # argument parser
        arg_parser = argparse.ArgumentParser(
            description="Simply flash B2G into device. Last update: {}".format(self.LAST_UPDATE),
            formatter_class=ArgumentDefaultsHelpFormatter,
        )
        arg_parser.add_argument(
            "-l", "--list", action="store_true", dest="list", default=False, help="List supported devices and branches."
        )
        arg_parser.add_argument(
            "-v",
            "--verbose",
            action="store_true",
            dest="verbose",
            default=False,
            help="Turn on verbose output, with all the debug logger.",
        )

        # parse args and setup the logging
        args = arg_parser.parse_args()
        # setup the logging config
        if args.verbose is True:
            verbose_formatter = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
            logging.basicConfig(level=logging.DEBUG, format=verbose_formatter)
        else:
            formatter = "%(levelname)s: %(message)s"
            logging.basicConfig(level=logging.INFO, format=formatter)
        if args.list is True:
            self.show_support_devices()
            self.show_support_branches()
            exit(0)
        # check ADB
        AdbWrapper.check_adb()
        # return instance
        return self
开发者ID:askeing,项目名称:b2g-util-python,代码行数:40,代码来源:quick_flash.py


注:本文中的util.adb_helper.AdbWrapper.check_adb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。