A strange one this. I have got myself into a situation where I think that a single apk is causing boot to fail. I have the same situation on a Nexus 4 and Nexus 7 running 4.4.
adb install <com.myapp.package> would hang - then the device would reboot - then would get stuck on
Android is upgrading...Optimising app 1 of 1.
I can list packages through
adb shell at this point - but uninstalling with
pm uninstall <com.myapp.package>
will just hang - presumably as the current process is doing something with that apk already.
If i try to boot into recovery at this point i get a dead android with a "no command" message.
Fastboot is locked on the device and its not rooted.
My only option at this point i think is to unlock fastboot but was wondering if im missing something.
EDIT: I just wiped via fastboot on one device and it works again - dont really want to do this on other device if poss