How to upgrade SystemUI.apk on emulator and real device

1,736 views
Skip to first unread message

Jitesh dedhiya

unread,
May 31, 2013, 7:32:41 AM5/31/13
to android-...@googlegroups.com
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!

KaPiL.rIcKy

unread,
Jun 2, 2013, 11:44:32 AM6/2/13
to android-...@googlegroups.com
did u try remounting and directly pushing to systema/app ?

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks and regards
Kapil Kumar
~~~~~~~~~~~~~~~~~~~~~~~~~~

Jitesh dedhiya

unread,
Jun 3, 2013, 12:13:04 AM6/3/13
to android-...@googlegroups.com
Yeah i tried that too,
$ adb remount
   remount succeeded
$ adb push SystemUI.apk /system/app/
   failed to copy 'SystemUI.apk' to '/system/app//SystemUI.apk': Out of memory

Then i deleted some *.odex and *.apk from /system/app to make some space, and tried again to copy, it succeeded but that not i want (deleting other apks). There has to be some standard approach right ?. If we do this, still emulator don't have the updated behavior of newly copied System.apk.
What am i missing ? 
And this talks about emulator, what about real device how other people do these up-gradations in real time ?




--
You received this message because you are subscribed to a topic in the Google Groups "android-platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-platform/gK360GzkfCs/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to android-platfo...@googlegroups.com.

To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
--Jitesh .V. Dedhiya---

Don't Learn To Hack but Hack To Learn

Jean-Baptiste Queru

unread,
Jun 3, 2013, 12:16:43 AM6/3/13
to android-...@googlegroups.com
Oh, one problem might be that the emulator is configured with a default size for the system partition that's smaller than system.img (200MB vs ~230MB IIRC). It deals with that by actually growing to the exact size, but that means that there's no free space. I don't remember off-hand if there's a way to make the emulator reserve e.g. 300MB without modifying its source.

JBQ
Jean-Baptiste M. "JBQ" Queru
Technical Lead, Android Open Source Project, Google.

Questions sent directly to me that have no reason for being private will likely get ignored or forwarded to a public forum with no further warning.

Jitesh dedhiya

unread,
Jun 3, 2013, 4:13:39 AM6/3/13
to android-...@googlegroups.com
Ok. But then how Google does up-gradations of their own apps (market app + other system apps like calendar etc). I want to understand the technical process how this is handled by google. My question is around its implementation, how one can achieve that on emulator or real device (up-gradation of system apps i.e in my case SystemUI.apk how do i perform its upgrade).

As per @JBQ latest comment, it doesn't solve/concludes the solution to the problem right ?

Would be great if anybody share their experience or inputs on these please.

Jean-Baptiste Queru

unread,
Jun 3, 2013, 8:40:00 AM6/3/13
to android-...@googlegroups.com
SystemUI isn't a Google app, it's a system app. On devices engineered by Google, it's upgraded via recovery as part of system upgrades.

Other than during system upgrades, other Google apps (e.g. Gmail) are updated through the Play Store, i.e. the version downloaded from the Play Store is stored in the data partition, not in the system partition. The Play Store itself uses a very similar mechanism, with a few twists so that it can update itself.

JBQ

Jitesh dedhiya

unread,
Jun 4, 2013, 1:53:17 AM6/4/13
to android-...@googlegroups.com
I understand the System app and non-System apps, but my query is, if i made any changes to the system app like SystemUI.apk, Calendar, Calculator (Stock apps found in system/app folder), then how the upgrade for these are handled. 

Let me ask in a simpler way, say a developer wants to test the changes made into one of these apps code, then how can be the apk deployed onto running emulator or devices ?. Also if we add a new app as part of stock rom apps, then how can its upgrade handled. ?

For non-system apps its easy that u connect usb and install the app, but what is the process involved for System apps ? - Does this mean a whole System.img needs be created (i.e make ) again whenever we do a minor change in any app code to get reflected. There has to be some way, without recreating the system.img for each change

hemant shinde

unread,
Jun 4, 2013, 3:24:29 AM6/4/13
to android-...@googlegroups.com
Hi Jitesh,

To increase the emulator memory size, you can use the command line option:

$ emulator -partition-size 256

Then try to use the adb push command.
This approach worked for us.

Thanks,
Hemant
Message has been deleted

Jitesh dedhiya

unread,
Jun 4, 2013, 7:00:35 AM6/4/13
to android-...@googlegroups.com
Hey Thanks Hemant for the reply.

But have you/anybody done an installation/upgradation of existing system apk on already running emulator or real device.

I tried with my hello world app which is a part of stock rom  and i did some change into the layout of it and tried to install the updated one but i get this error
$ adb install -r out/target/product/generic/system/app/HelloWorld.apk
78 KB/s (8956 bytes in 0.112s)
pkg: /data/local/tmp/HelloWorld.apk
Failure [INSTALL_FAILED_DEXOPT]   // Does anyone faced this error. How to resolve it ?

$ adb push out/target/product/generic/system/app/HelloWorld.apk does copy the updated one. 

So can i assume that the up-gradation of SystemUI.apk or any other system app happens via this command ( a script having these commands) on real production devices ?

Karthik

unread,
Jun 4, 2013, 7:16:05 AM6/4/13
to android-...@googlegroups.com
Hi,

As JBQ has already pointed out, system apps are upgraded via recovery as a part of system upgrade.

Best regards,
Karthik

hemant shinde

unread,
Jun 4, 2013, 7:22:56 AM6/4/13
to android-...@googlegroups.com
Hi Jitesh,

I am not aware of the best way to push the SystemUI.apk on production devices.
I think that we might need to use flashable zips to install it.

Anybody has any other solution?

Thanks,
Hemant

hemant shinde

unread,
Jun 10, 2013, 12:26:46 AM6/10/13
to android-...@googlegroups.com
We can change the systemui on rooted tablet.

Procedure:

$ adb root
# After above command the user will have to enable the debugging on tablet again.

$ adb remount
# Go to the directory where new SystemUI.apk is stored
$ cd $APKDIR

# Connect to the android device
$ adb shell

# Remove the systemUI apk from device
root@android # rm system/app/SystemUI.apk
root@android # exit

#Push the new apk to device
$ adb push SystemUI.apk system/app/

Done !

Rohit Rokde

unread,
Feb 11, 2014, 12:42:53 AM2/11/14
to android-...@googlegroups.com
This might help someone if not to the person who posted the question.
From what I see, the flashed system image was of Quick boot mode and you are probably trying to push APK of normal mode. The former one does not contain .dex in it and the latter one has. So you either flash system image of normal build or deodex your targets system image and flash it again(pretty similar to the 1st one anyways)..
Reply all
Reply to author
Forward
0 new messages