0

After each OTA Android upgrade, I get a message saying "Optimizing app x of xxx" that takes a while. The last time I upgraded, the battery ran out during the optimization process (not during the upgrade itself, which I know it's dangerous). After rebooting the phone the "optimization" process didn't carry on.

So, how can I start that process by itself without upgrading anything? (my Android is already up to date).

OMA
  • 363
  • 3
  • 5
  • 13
  • 1
    Are you facing a problem in the device? – Firelord Mar 14 '16 at 19:05
  • 1
    Well, not really, but since the "app optimization" was interrupted, I thought it would be a good idea to actually finish it. – OMA Mar 14 '16 at 19:25
  • A better question would be, does the "app optimization" actually optimize anything? Or does it just check app compatibility with the new OTA? Or does it clear cache on each app? Or does it generate new .odex files? Those would be good questions. – Aaron Gillion Mar 14 '16 at 21:24
  • 2
    I believe any un-optimized apps will be optimized on their first run, if they haven't been already. – Matthew Read Mar 14 '16 at 21:49
  • I don't know the innards of Android to ask all those questions, but then I'd ask, if it makes little difference as you seem to imply and the apps are "optimized" on first run anyway, why make the user wait such a long time (especially when several hundreds of apps are installed) for nothing after every upgrade? – OMA Mar 14 '16 at 22:41
  • 3
    @MatthewRead Eldarerathis once analyzed what that optimization does. Basically it re-creates the Dalvik (or now ART) cache for each app, dropping the old version and re-creating it with the updated engine (it "invokes the dexopt utility on all of the applications that need it."). So you should be right. If I had designed that process, I'd first drop the entire cache and then walk the apps – so that, if interrupted, the first start of the remaining ones would take care for the remains. – Izzy Mar 14 '16 at 22:58
  • 1
    @OMA because at upgrade time, the user "expects" to wait – while not expecting each app to "start that slow" directly after the upgrade? – Izzy Mar 14 '16 at 23:01

1 Answers1

2

Go into the recovery (you need to boot the phone while pressing several buttons - you'll need to google which one is set for your device - an example would be Volume down + Home) and delete the "Dalvik cache". Then restart your phone. Now the optimizing process should start again.

But I personally recommend to not do that - it can't hurt, but if your phone works well you don't need this, because it's just like a Backup of your app installation files.

Namnodorel
  • 294
  • 2
  • 11