top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Set Dalvik execution mode in /data/local.prop using Android

0 votes
809 views

I tried to run Dalvik in portable mode by setting /data/local.prop as follows:

dalvik.vm.execution-mode = int:portable

But after I reboot the device (which is a Nexus 7), app_process (hosting zygote) still starts in jit mode.

However, if I run:

adb shell stop
adb shell setprop dalvik.vm.execution-mode int:portable
adb shell start

Then app_process will run in portable mode. Is /data/local.prop deprecated or something is missing here?

posted Jun 24, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

You see that one that you set in local.prop is the backing file that is loaded by init process during bootup. Whatever that is read is stored into a shared memory area that every app has access to if it links the property service library.
Do this echo $ANDROID_PROPERTY_WORKSPACE You will see two comma seperated values. First one is Fd to the shared mem and next is size , This is how the sharedmem region is mmaped into your process .
So setting in local.prop will work only if you reboot the device.

answer Jun 24, 2013 by anonymous
I always use the eng build variant. So I think there should be something else that is missing. Is there any requirement on the file permission of /data/local.prop?

Also, I don't quite believe Dalvik cache will have an effect on this. But for safety I recompiled again with eng build variant, wiped the cache, set the file permission to 750 root:root, rebooted, and it works.
The file permission change was at least one of the causes ... it needs to be non-writable by group and world, otherwise the file is ignored.
I think it's the cause in my case. But I didn't find any documentation about this. It's just my intuition that tells me something looks peculiar if I don't change the file permission... Is this documented anywhere?
Similar Questions
0 votes

I was experimenting something with Android native code and it needs to access a file in dalvik/vm folder from a .cpp file in frameworks/base/core/jni ... I would like to know if this is even possible through #include or some other technique. I think #include may not be the right way to do it and wold like to know if my purpose can be somehow achieved.

+1 vote

I've a problem of not having enough permissions for setting a “persist.xxxxx” property from one of the applications. This application shares the User-id of the phone so I tried to hack in property_service.c and add an entry:

{“persist.”, AID_RADIO, 0} 
in property_perms structure. 

After this I was able to set the property but without this I get a “permission denied” error "> init: sys_prop: permission denied uid:1001 name:persist.xxxxx". Any clue...

+1 vote

Hi, Being a learner. I am here to participate just like other android developer forum to enhance my knowledge regarding Android Programming & I would like to know that "how to debug my database and shared preferences in an android application", which has become difficult to debug. I hope any tech developer help me in resolving this issue.

...