Replacing modified apk in system/app?

2,611 views
Skip to first unread message

Jeff

unread,
Apr 6, 2012, 6:36:48 PM4/6/12
to android-...@googlegroups.com
Hi,

I've just started working on a feature that is missing from one of the stock apps in the System folder.  I'm new to developing for android, but not new to embedded development at all.  I've got this built from 4.0.4 and running on my device, but as I make changes to the app and libraries, I'd like to test those changes and that's where I'm looking to speed up the process.

After re-building the apk in question, what is the best way to replace it on my device?  I was using `adb install -r path/to/apk.apk` and while that succeeds, I realized that it wasn't changing the app in system/app on device.  Next I tried `adb push ...` which returns with an error as system/app is read-only.  Next, `adb remount` to then do a push, but the remount fails with a 'Operation not permitted'.

Now information about my build, and maybe here's where I'm going wrong.  I've built 4.0.4 with the lunch option for full_maguro (so userdebug on a Galaxy Nexus), do I need to use the build type as eng to be able to remount system as r/w?  Or how can this be done?

Can I just re-flash the system.img?  And if so what does that do to the phone in terms of usability?  I'd want to avoid having to re-setup my phone every time I make changes to the code as this isn't a dedicated development device per se (it's only used by me, but it's my day to day use phone as well as a place to develop.  

Thanks,
Jeff.

unifun

unread,
Apr 6, 2012, 8:52:00 PM4/6/12
to android-...@googlegroups.com
If you built your ics source code with user debug type, try below steps:

adb root
adb remount
adb push xxx /system/app/xxx
adb reboot

I suggest you using user debug build. Eng build will open some kernel options sometimes that will greatly influence the performance.
  

Best Regards

unifun


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/wvQoAQ9WazMJ.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

Dianne Hackborn

unread,
Apr 6, 2012, 8:52:26 PM4/6/12
to android-...@googlegroups.com
You can use "adb root" to have adb running a root shell.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/wvQoAQ9WazMJ.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.



--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Dianne Hackborn

unread,
Apr 6, 2012, 8:53:16 PM4/6/12
to android-...@googlegroups.com
Unless you are replacing a persistent app, you shouldn't need to reboot after pushing the new .apk.  The package manager monitors that directory and takes care of updating when something there changes.

Jeff

unread,
Apr 6, 2012, 9:11:30 PM4/6/12
to android-...@googlegroups.com
Thanks, that did it.  Missing the command to run adb as root.

And Dianne, I was able to replace both apps (Phone and Contacts) without rebooting to see my changes, so thanks, that will save time as well.

Jeff.

jag

unread,
Jul 2, 2014, 12:07:44 PM7/2/14
to android-...@googlegroups.com
Hi Jef,

What changes have you made in system apps? 

I notice that if I make changes to the system apps, android prevents them to run as it detects the changes...(probably through signature verification!)

ch...@christopherprice.net

unread,
Jul 3, 2014, 11:57:20 AM7/3/14
to android-...@googlegroups.com
Depends on the device/configuration - especially if your device has a security suite like Samsung KNOX.

Christopher Price
Reply all
Reply to author
Forward
0 new messages