Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade SystemUI.apk on emulator and real device

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

1. $ . build/envsetup.sh
2. $ lunch 1 // normal emulator
3. $ make -j4

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

4. $ mmm frameworks/base/packages/SystemUI   //Creates the SystemUI.odex & SystemUI.apk in the out/target/product/generic/system/app/

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 ?

Note: 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).

So please suggest in these two context (emulator and real device scenarios), how to achieve that.

I have already tried with adb commands using

$ adb install -r out/target/product/generic/system/app/SystemUI.apk on emulator but it gives the error INSTALL_FAILED_DEXOPT

Help Appreciated!

like image 910
user755499 Avatar asked May 31 '13 08:05

user755499


People also ask

What is SystemUI APK?

SystemUI is the application that controls all the window decor you see on your device. It is a core application running as part of the system framework. The following items are handled/drawn by SystemUI: Top status bar. Notification window shade (and the notifications inside)

What is the UI system on your phone?

System UI is a type of user interface that enables users to control and customize their displays independent of an app. System UI is an Android application that enables display customization independent of third-party apps. In even simpler terms, everything you see on Android that is not an app is System UI.

Where can I find SystemUI APK?

Since Android 4.4, all privileged system apps including SystemUI have been moved to /system/priv-app .


1 Answers

Sorry, I don't have my environment setup to test this suggestion easily, but for the emulator, instead of adb install, try using adb push (supplying the desired path for both source and destination). You might need to make sure the system partition is not read-only by remounting it first:

    adb remount
    adb push out/target/product/generic/system/app/SystemUI.apk /system/app

After that, I think you might need to restart the com.android.systemui process too by using adb shell ps and adb shell kill nnnn (with nnnn = PID from the ps command).

You might also want to look at the adb sync command since it can automatically detect which files needed updating:

adb sync [ <directory> ]     - copy host->device only if changed
                               (-l means list but don't copy)
notes: 
  <localdir> can be interpreted in several ways:
  - If <directory> is not specified, both /system and /data 
    partitions will be updated.
  - If it is "system" or "data", only the corresponding partition
    is updated.

PS: If you get an "Out of memory" error when pushing the file, you might need to modify your emulator launch options to include a larger partition size:

    emulator -partition-size 512

Hope this helps!

like image 57
Joe Avatar answered Nov 09 '22 23:11

Joe