title: How to upgrade SystemUI.apk on emulator and real device
body: <p>I am working on custom ROM, where i need to perform some customization to SytemUI (e.g. statusbar). So, here are the steps that i do</p>
  
  <pre><code>1. $ . build/envsetup.sh
  2. $ lunch 1 // normal emulator
  3. $ make -j4
  </code></pre>
  
  <p>Once my emulator is up and running with default jellybean 4.2.2 AOSP, i then do some changes in the statusbar layout e.g. i change the bg color and then i perform</p>
  
  <pre><code>4. $ mmm frameworks/base/packages/SystemUI   //Creates the SystemUI.odex &amp; SystemUI.apk in the out/target/product/generic/system/app/
  </code></pre>
  
  <p>So how do i update this SystemUI apk on to the running emulator/device ?
  Which all other apks will be required along with SystemUI apk during its upgarde ?</p>
  
  <p><strong>Note</strong>: This case would be valid for real devices where i want to send update of SystemUI.apk OTA to the users of that device i.e. e.g. currently what google does for play market app (automatically gets updated without the need of rebooting the device). </p>
  
  <p>So please suggest in these two context (emulator and real device scenarios), how to achieve that.</p>
  
  <p>I have already tried with adb commands using</p>
  
  <p><code>$ adb install -r out/target/product/generic/system/app/SystemUI.apk</code>
   on emulator but it gives the error <strong>INSTALL_FAILED_DEXOPT</strong> </p>
  
  <p>Help Appreciated!</p>