2011. 7. 28. 05:57

Controlling the Embedded VM

원본: http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/embedded-vm-control.html;hb=HEAD

위 링크 원본 중 일부만 발췌하였습니다. 눈여겨 볼 것은 adb shell stop; adb shell start; 를 이용하는 것, /data/local.prop 파일의 존재, 그리고 아래 명령어 입력 방식.

adb shell "echo name = value >> /data/local.prop"

( 따옴표를 빠뜨리지 않아야 합니다!)

asb shell stop; adb shell start; 는 stdio, strerr 설정에서도 나옵니다.
$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start

Introduction (read this first!)
 
The Dalvik VM supports a variety of command-line arguments (use adb shell dalvikvm -help to get a summary), but it's not possible to pass arbitrary arguments through the Android application runtime. It is, however, possible to affect the VM behavior through certain system properties. 

For all of the features described below, you would set the system property with setprop, issuing a shell command on the device like this: 

adb shell setprop <name> <value>

 
The Android runtime must be restarted before the changes will take effect (adb shell stop; adb shell start). This is because the settings are processed in the "zygote" process, which starts early and stays around "forever". 

You may not be able to set dalvik.* properties or restart the system as an unprivileged user. You can use adb root or run the su command from the device shell on "userdebug" builds to become root first. When in doubt, 

adb shell getprop <name>

 
will tell you if the setprop took. 
If you don't want the property to evaporate when the device reboots, add a line to /data/local.prop that looks like: 

<name> = <value>

 
Such changes will survive reboots, but will be lost if the data partition is wiped.

(Hint: create a local.prop on your workstation, then adb push local.prop /data. Or, use one-liners like adb shell "echo name = value >> /data/local.prop" -- note the quotes are important.