Android dalvik虚拟机

时间:2012-01-26 21:35:03

标签: android process dalvik

我想知道,Android OS中有没有办法启动一个新的Dalvik虚拟机,它不是通过adb shell,ndk或java从主要的zygote进程(zygote虚拟机)分叉出来的?

是否有人尝试在其中一个adb命令中成功使用:app_process,dalvikvm,dvz?

感谢您的帮助

1 个答案:

答案 0 :(得分:4)

  1. 使用dx将字节码转换为dex
  2. 使用dalvikvm来运行它
  3. 如果您需要帮助,请使用-help选项

    $ dalvikvm -help
    
    dalvikvm: [options] class [argument ...]
    dalvikvm: [options] -jar file.jar [argument ...]
    
    The following standard options are recognized:
      -classpath classpath
      -Dproperty=value
      -verbose:tag  ('gc', 'jni', or 'class')
      -ea[:<package name>... |:<class name>]
      -da[:<package name>... |:<class name>]
       (-enableassertions, -disableassertions)
      -esa
      -dsa
       (-enablesystemassertions, -disablesystemassertions)
      -showversion
      -help
    
    The following extended options are recognized:
      -Xrunjdwp:<options>
      -Xbootclasspath:bootclasspath
      -Xcheck:tag  (e.g. 'jni')
      -XmsN  (min heap, must be multiple of 1K, >= 1MB)
      -XmxN  (max heap, must be multiple of 1K, >= 2MB)
      -XssN  (stack size, >= 1KB, <= 256KB)
      -Xverify:{none,remote,all}
      -Xrs
      -Xint  (extended to accept ':portable' and ':fast')
    
    These are unique to Dalvik:
      -Xzygote
      -Xdexopt:{none,verified,all,full}
      -Xnoquithandler
      -Xjnigreflimit:N  (must be multiple of 100, >= 200)
      -Xjniopts:{warnonly,forcecopy}
      -Xjnitrace:substring (eg NativeClass or nativeMethod)
      -Xstacktracefile:<filename>
      -Xgc:[no]precise
      -Xgc:[no]preverify
      -Xgc:[no]postverify
      -Xgc:[no]concurrent
      -Xgc:[no]verifycardtable
      -XX:+DisableExplicitGC
      -X[no]genregmap
      -Xverifyopt:[no]checkmon
      -Xcheckdexsum
    

    您还可以为x86编译dalvikvm并在主机中运行它。