当前位置: 首页 > news >正文

Android JIT编译:adb shell cmd package compile选项

Android JIT编译:adb shell cmd package compile选项

例如:

adb shell cmd package compile -m speed -f --full 包名

配置参数指令说明:

  compile [-r COMPILATION_REASON] [-m COMPILER_FILTER] [-p PRIORITY] [-f]
      [--primary-dex] [--secondary-dex] [--include-dependencies] [--full]
      [--split SPLIT_NAME] [--reset] [-a | PACKAGE_NAME]
    Dexopt a package or all packages.
    Options:
      -a Dexopt all packages
      -r Set the compiler filter and the priority based on the given
         compilation reason.
         Available options: 'first-boot', 'boot-after-ota',
         'boot-after-mainline-update', 'install', 'bg-dexopt', 'cmdline'.
      -m Set the target compiler filter. The filter actually used may be
         different, e.g. 'speed-profile' without profiles present may result in
         'verify' being used instead. If not specified, this defaults to the
         value given by -r, or the system property 'pm.dexopt.cmdline'.
         Available options (in descending order): 'speed', 'speed-profile',
         'verify'.
      -p Set the priority of the operation, which determines the resource usage
         and the process priority. If not specified, this defaults to
         the value given by -r, or 'PRIORITY_INTERACTIVE'.
         Available options (in descending order): 'PRIORITY_BOOT',
         'PRIORITY_INTERACTIVE_FAST', 'PRIORITY_INTERACTIVE',
         'PRIORITY_BACKGROUND'.
      -f Force dexopt, also when the compiler filter being applied is not
         better than that of the current dexopt artifacts for a package.
      --reset Reset the dexopt state of the package as if the package is newly
         installed.
         More specifically, it clears reference profiles, current profiles, and
         any code compiled from those local profiles. If there is an external
         profile (e.g., a cloud profile), the code compiled from that profile
         will be kept.
         For secondary dex files, it also clears all dexopt artifacts.
         When this flag is set, all the other flags are ignored.
      -v Verbose mode. This mode prints detailed results.
      --force-merge-profile Force merge profiles even if the difference between
         before and after the merge is not significant.
    Scope options:
      --primary-dex Dexopt primary dex files only (all APKs that are installed
        as part of the package, including the base APK and all other split
        APKs).
      --secondary-dex Dexopt secondary dex files only (APKs/JARs that the app
        puts in its own data directory at runtime and loads with custom
        classloaders).
      --include-dependencies Include dependency packages (dependencies that are
        declared by the app with <uses-library> tags and transitive
        dependencies). This option can only be used together with
        '--primary-dex' or '--secondary-dex'.
      --full Dexopt all above. (Recommended)
      --split SPLIT_NAME Only dexopt the given split. If SPLIT_NAME is an empty
        string, only dexopt the base APK.
        Tip: To pass an empty string, use a pair of quotes ("").
        When this option is set, '--primary-dex', '--secondary-dex',
        '--include-dependencies', '--full', and '-a' must not be set.
      Note: If none of the scope options above are set, the scope defaults to
      '--primary-dex --include-dependencies'.
  
  delete-dexopt PACKAGE_NAME
    Delete the dexopt artifacts of both primary dex files and secondary dex
    files of a package.
  
  bg-dexopt-job [--cancel | --disable | --enable]
    Control the background dexopt job.
    Without flags, it starts a background dexopt job immediately and waits for
      it to finish. If a job is already started either automatically by the
      system or through this command, it will wait for the running job to
      finish and then start a new one.
    Different from 'pm compile -r bg-dexopt -a', the behavior of this command
    is the same as a real background dexopt job. Specifically,
      - It only dexopts a subset of apps determined by either the system's
        default logic based on app usage data or the custom logic specified by
        the 'ArtManagerLocal.setBatchDexoptStartCallback' Java API.
      - It runs dexopt in parallel, where the concurrency setting is specified
        by the system property 'pm.dexopt.bg-dexopt.concurrency'.
      - If the storage is low, it also downgrades unused apps.
      - It also cleans up obsolete files.
    Options:
      --cancel Cancel any currently running background dexopt job immediately.
        This cancels jobs started either automatically by the system or through
        this command. This command is not blocking.
      --disable: Disable the background dexopt job from being started by the
        job scheduler. If a job is already started by the job scheduler and is
        running, it will be cancelled immediately. Does not affect jobs started
        through this command or by the system in other ways.
        This state will be lost when the system_server process exits.
      --enable: Enable the background dexopt job to be started by the job
        scheduler again, if previously disabled by --disable.
    When a list of package names is passed, this command does NOT start a real
    background dexopt job. Instead, it dexopts the given packages sequentially.
    This usage is deprecated. Please use 'pm compile -r bg-dexopt PACKAGE_NAME'
    instead.

Android JIT( ART即时编译器),Just In Time Compiler,即时编译技术-CSDN博客文章浏览阅读560次,点赞6次,收藏6次。Android Runtime (ART) 包含一个具备代码分析功能的即时 (JIT) 编译器,该编译器可以在 Android 应用运行时持续提高其性能。JIT是Just In Time Compiler,即时编译技术。JIT:以下是 ART 实现的一些主要功能。ART 引入了预先编译机制,可提高应用的性能。ART 还具有比 Dalvik 更严格的安装时验证。在安装时,ART 使用设备自带的 dex2oat 工具来编译应用。 https://blog.csdn.net/zhangphil/article/details/147520790

相关文章:

  • HarmonyOS应用开发中实现本地化存储的几种方式
  • 为什么大模型偏爱Markdown
  • 嵌入式C语言的运算符与输入输出
  • AWS CloudFront全球加速利器:解析出海业务的核心优势与最佳实践
  • MySQL | DQL语句-连接查询
  • Linux Shell 重定向与管道符号(>, >>, |)的实现机制
  • Perforated Backpropagation:神经网络优化的创新技术及PyTorch使用指南
  • terraform生成随机密码
  • 哈希表笔记(四)Redis对比Java总结
  • Unity SpriteAtlas (精灵图集)
  • 深度学习框架:PyTorch使用教程 !!
  • SpringBoot云端日记本系统开发实现
  • Redis的键过期删除策略与内存淘汰机制详解
  • 论文阅读:MAXIM Multi-Axis MLP for Image Processing
  • 单片机-89C51部分:13、看门狗
  • PostgreSQL数据库操作SQL
  • Kotlin-运算符重载函数
  • SAE极速部署弹性微服务商城——实验记录
  • Cookie 是什么?
  • Python 与 MongoDB 深度融合:全流程数据库操作指南
  • 韩代总统李周浩履职
  • 长江财险一季度净亏1449.81万元,去年曾实现扭亏为盈
  • 特朗普宣布提名迈克·沃尔兹为下一任美国驻联合国大使
  • 乌方公布矿产协议详情:未提债务义务,包含美再援助条款
  • 人民日报钟声:国际社会应共同维护科学溯源的正确方向
  • 空调+零食助顶级赛马备战,上海环球马术冠军赛将焕新登场