[Nexus 5 General] cheep5k8:
My first instructions are step-by-step instructions on how to enable ART using ADB.

In my second instructions I explained a best practice on what to do before switching to art.

Basically, wipe /cache, /system, dalvik cache storage. Make sure you have your latest MIUI ZIP as well as all other ZIPs you flashed when first installing on the internal storage (some kernel, or the Xperia Keyboard, etc., if you're not using Pretoriano80's build).

Do not wipe /data. It's not neccessary. After you're done with this, the system won't know you reflashed it. I'm asking to format and reflash /system so all traces of WSM or whatever are gone. You could use the recovery uninstaller ZIP but I would not recommend it if there are troubles already.

OK so first of all you boot up as normal. You uninstall WSM Tools, Mi-Tools and all other modules. Then go to recovery.

In recovery, you format /system, /cache and dalvik. Then flash MIUI ZIP, other ZIPs, at least the ones you already had flashed before reformatting and flashing /system.

Then you boot up into MIUI and the first thing you do is you connect your phone to your computer which has ADB installed and working.

Then you open up a shell, a CMD window, or whatever in whatever operating system you use.

Then:

adb shell

This will open a shell on the Nexus 5 via ADB.

Now if you have that, immediately after that you type:

su

The screen of the Nexus has to be on in order to confirm the root privilege for the shell. It's just the normal couple of MIUI dialogs which ask you to confirm root rights for whatever is requesting them, in this case the shell.

Once you have a root prompt, which looks like this:

root@hammerhead:/ #

you can proceed. If the prompt does not look like this you did something wrong and need to recheck your previous ADB steps.

If it does look like that and you have a root shell, you type:

setprop persist.sys.dalvik.vm.lib libart.so

and press enter. Just that.

This will all look like this:

shell@hammerhead:/ $ su
root@hammerhead:/ # setprop persist.sys.dalvik.vm.lib libart.so
setprop persist.sys.dalvik.vm.lib libart.so
root@hammerhead:/ #

Once this is done, exit the shell (press CTRL+D twice). If this hangs, chances are the display of your Nexus has turned off to sleep, in which case you simply close the window with the shell on your Windows, Linux, OS X, etc.

Then reboot the phone normally via the menu through the power button.

Again, I urge to do nothing between reflashing as described above and enabing ART. No setup, no install of apps, nothing. If the phone does something by itself, that's fine, just let it do it, but you should do the shell+setprop thing.

One more thing, since you didn't say what exactly didn't work: If you connect through ADB then the Nexus might ask you for permission for this specific computer to connect via ADB. It might, it might not if you had already allowed it before. In any case while you connect via ADB, the screen of the Nexus should be on. Just so you don't miss anything like the ADB request or the root confirmation request. MIUI won't let you in via ADB shell as long as the phone is locked anyway. Correction: MIUI won't let you get a root shell as long as the phone is locked anyway.

OK I hope this helps more. If it still doesn't work, please post what exactly of the above steps didn't work. Thanks.

Regards

c5