dex-preopt,使用方法

#
# Usage: dex-preopt [options] path/to/input.jar path/to/output.odex
#
# This tool runs a host build of dalvikvm in order to preoptimize dex
# files that will be run on a device

.
# The input may be any sort of jar file (including .apk files), as long
# as it contains a classes.dex file. Note that optimized versions of
# bootstrap classes must be created before this can be run on other files;
# use the "--bootstrap" option to do this.
#
# The "output.odex" file must not already exist.

 

#
# This is expected to be running in a user build environment, where
# "dexopt" is available on the host.
#
# Options:
#   --build-dir=path/to/out -- Specify where the base of the build tree is.
#     This is typically a directory named "out". If not specified, it is
#     assumed to be the current directory. The specified input and output
#     paths are taken to be relative to this directory.
#   --dexopt=path/to/dexopt -- Specify the path to the dexopt executable.
#     If unspecified, there must be a unique subdirectory of the build-dir
#     that looks like host/ARCH/bin which must contain dexopt.
#   --product-dir=path/to/product -- Specify the path, relative to the build
#     directory, where the product tree to be used is. This directory should
#     contain the boot classpath jar files. If not specified, then there
#     must be a unique directory in the build named "target/product/NAME",
#     and this is the directory that will be used.
#   --boot-dir=path/to/bootclasspath -- Specify the path, relative to the
#     product directory, of the directory where the boot classpath files
#     reside. If not specified, this defaults to "system/framework"
#   --boot-jars=list:of:jar:base:names -- Specify the list of base names
#     of bootstrap classpath elements, colon-separated. Order is significant
#     and must match the BOOTCLASSPATH that is eventually specified at
#     runtime on the device. This defaults to "core". However, this really
#     needs to match the target product's BOOTCLASSPATH, which, as of this
#     writing, doesn't have a super-strict way of being defined within the
#     build. You can find variations of it in different init.rc files under
#     system/core/rootdir or under product-specific directories.
#   --bootstrap -- Process the bootstrap classes. If this is specified,
#     then, instead of processing a specified input file, no other arguments
#     are taken, and what is processed is the entirety of the boot jar
#     list, in order.
#   --verify={none,remote,all} -- Specify what level of verification to
#     do. Defaults to "all".
#   --optimize={none,verified,all} -- Specify which classes to optimize.
#     Defaults to "verified".
#   --no-register-maps -- Indicate that the output should not contain
#     register maps. By default, register maps are created and included.
#   --uniprocessor -- Indicate that the output should target a uniprocessor.
#     By default, optimizations will be made that specifically target
#     SMP processors (which will merely be superfluous on uniprocessors).
#

  43 # $(1): the input .jar or .apk file
  44 # $(2): the output .odex file
  45 define dexpreopt-one-file
  46 $(hide) $(DEXPREOPT) --dexopt=$(DEXPREOPT_DEXOPT) --build-dir=$(DEXPREOPT_BUILD_DIR) \
  47     --product-dir=$(DEXPREOPT_PRODUCT_DIR) --boot-dir=$(DEXPREOPT_BOOT_JAR_DIR) \
  48     --boot-jars=$(DEXPREOPT_BOOT_JARS) $(DEXPREOPT_UNIPROCESSOR) \
  49     $(patsubst $(DEXPREOPT_BUILD_DIR)/%,%,$(1)) \
  50     $(patsubst $(DEXPREOPT_BUILD_DIR)/%,%,$(2))
  51 endef


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值