22

I wanted to try out the new ART runtime, but didn't realize my custom ROM doesn't support it. So now I am getting recurring Force Closed messages after booting, and can't get through to the settings menu to switch back to Dalvik. So before I wipe everything and spend hours setting up my phone from scratch, is there a way to manually change back to Dalvik from the recovery menu? I think there should be a flag somewhere, that instructs Android to do the 'recompile' after a reboot.

Via the recovery menu, I have full root access over a adb shell and can mount all filesystems.

David B.
  • 223
  • 1
  • 2
  • 4
  • I had a problem with ART on a stock 4.4.4 ROM. A few days after switching from dalvik, I was stuck in a boot loop with adb logcat showing a lot of crash errors including `art/runtime/runtime.cc:203] Runtime aborting... Switching back to dalvik, I had to reboot into recovery and use the echo command to switch back to dalvik. That fixed the problem – Stan Kurdziel Apr 12 '15 at 16:32

1 Answers1

19

I just did this!

/data/property/persist.sys.dalvik.vm.lib is a textfile containing one of two values: 'libart.so' or 'libdvm.so'. You can change from ART to Dalvik simply by editing this file.

Ex: adb shell 'echo libdvm.so >/data/property/persist.sys.dalvik.vm.lib'

ale
  • 19,723
  • 34
  • 110
  • 159
mysteriousllama
  • 206
  • 2
  • 2
  • 6
    FWIW, doing "setprop persist.sys.dalvik.vm.lib libdvm.so" would have the same effect -- the "persist" properties are persisted by writing them to a file. – fadden Apr 11 '14 at 18:28
  • When this happened to me, I had no adb shell access while Android was running. However, I was able to reboot into ClockworkMod Recovery, clear my cache partition and dalvik cache to free up some flash storage space, mount my /data partition, and then (finally) use adb shell as described in this answer. Whew! – ʇsәɹoɈ Jan 07 '15 at 09:45
  • I tried this on Android 5.0.1 (Omega V28) on my Galaxy S4 GT-I9500. The file was called /data/property/persist.sys.dalvik.vm.lib.2 in my case. After rebooting it somehow reverted to "libart.so". Any idea why it's doing that and how to change it permanently? – EM0 Jun 10 '17 at 13:33
  • This happened even when I changed the file contents via adb shell in recovery. So it's not getting overwritten on shutdown, but on boot, it seems. – EM0 Jun 10 '17 at 14:07