1

How do I (forcibly) remove the stock android Phone application from the emulator instance?

I would especially like answers from people who have actually successfully removed the Phone application.

Removing the Phone application probably also necessitates removing the Contacts application, as they are tightly integrated, that is fine.

Solution

After much research it seems the only solution is to rebuild the Android SDK from source, as Maciej Pigulski answered.

After fetching the android source, remove Phone and Contacts from the Android makefile build/target/product/core.mk. And build the SDK as usual, i.e.:

. build/envsetup.sh
lunch generic-eng
make sdk

And in out/host/linux-x86/sdk you will have a zip file containg a fresh new sdk ready for use in e.g. Eclipse.

Community
  • 1
  • 1
Bjarke Freund-Hansen
  • 28,728
  • 25
  • 92
  • 135
  • stock android application means ? system apps or third party apps ? – Sujit Jun 22 '11 at 12:53
  • i'm not sure how it works with an emulator, but you can possibly use "adb shell" to navigate to the system's apps dir (system/app) then do a rm Phone.apk. That might not work as you may need root privileges to do so – dymmeh Jun 22 '11 at 12:54
  • @Sujit: built-in app / system app / stock app. – Bjarke Freund-Hansen Jun 22 '11 at 12:55
  • you can't remove system apps. – Sujit Jun 22 '11 at 13:05
  • @Sujit I have full access to the filesystem images, they are on my disk. I have root access to the emulator phone `adb root`. Sure I can do anything I want, the question is just how to do it the easy way, if possible? – Bjarke Freund-Hansen Jun 23 '11 at 06:53

4 Answers4

2

I successfully remove Phone apps WITHOUT rebuilding the SDK (very long op...)

You can edit you system.img in your SDK (located for ex : ~/android-sdk-linux_x86/platforms/android-10/images/system.img) corresponding to the system part of your emulator ( Phone apos is located at /system/apps/Phone.apk)

I launched the emulator, connect with adb to the emulator shell. I removed the packaged /system/apps/Phone.pak after remounting the system partition with read/write option ( mount -o rw,remount /system /system )

I push into my emulator the mkfs.yaffs2 tools compiled for arm found here (http://code.google.com/p/android-group-korea/downloads/detail?name=mkfs.yaffs2.arm)

use this tools to recreate my system.img in my emulator shell: mkfs.yaffs2 /system /sdcard/system.img

pull the /sdcard/system.img into my PC. Replace the system.img of the emulator (~/android-sdk-linux_x86/platforms/android-10/images/system.img) and restart the emulator.

The Phone app is Gone!

Fabou
  • 21
  • 2
1

If you have root acces you can remove the .apk file that provides this app. You would have to look around in the folders on the device where it is installed.

Manuel
  • 10,153
  • 5
  • 41
  • 60
  • This is the emulator, thus I have root access. I have already tried that, it does not work. Even when I do `adb remount` to mount the /system partition in read-write mode, I am not allowed to do a `rm /system/app/Phone.apk`. I can however do a `echo "" > /system/app/Phone.apk` which I find weird that that works. However that just causes the emulator to keep displaying a dialogue saying the Phone app has crashed. – Bjarke Freund-Hansen Jun 22 '11 at 12:57
  • hmmm are you sure the Phone.apk is the one that makes the stock app? it looks like this apk is the os or something like that. – Manuel Jun 22 '11 at 12:59
  • Phone.apk and Contacts.apk makes the stock telephony app that you see, (e.g. dialer + call log tabs are from Phone.apk contacts tab is from Contacts.apk). I am sure of this. :) – Bjarke Freund-Hansen Jun 22 '11 at 13:04
  • Ok then i suppose it is a part of the emulator that can't be deleted. – Manuel Jun 22 '11 at 13:05
  • Funny thing is, if I compile my own android build, without the Phone and without the Contacts app, everything runs fine, except there is no telephony functionality. That leads me to believe that it should be possible to remove the Phone/Contacts app in a stock Android emulator. – Bjarke Freund-Hansen Jun 23 '11 at 06:57
1

I have an idea how this could be done but this is not an easy way.

It requires source code of the Android OS you need an emulator for. Then in the make files you can disable including of the Phone application to the output image and build the OS with 'make sdk' task. This will produce an SDK (like ones available from the Google site) with the binaries that has Phone application excluded. Then when you will create an emulator with this SDK it wont have the Phone.apk.

Painful but if you really need it, give it a try.

Maciej Pigulski
  • 1,562
  • 12
  • 26
  • I was really hoping not having to go that route, and just be able to hack together some shell script stripping out the apps using adb. But if this is the only possible course of action, then that is what I will do. – Bjarke Freund-Hansen Jun 28 '11 at 11:26
  • Okay, I just finished building a new SDK + emulator without the Phone and Contacts app, and it does indeed seem to work as expected. When pushing the Phone off button, it displays a toast with the message that no Phone app is installed. As expected. If nobody else comes up with a simpler solution in a few days, I will award you the bonus. Thanks. – Bjarke Freund-Hansen Jun 28 '11 at 11:45
0

It may be necessary to re-compile the Android OS that is running on the emulator. During the compile the default apps are rolled up into the build so it would be a matter of getting the egg before the chicken... or killing the chicken before it lays the egg...

Community
  • 1
  • 1
Brad Hein
  • 10,997
  • 12
  • 51
  • 74