Help create a script to remove .apk's on CM.9999 PLZ?? - G1 Q&A, Help & Troubleshooting

ok now there is a few apps i dont like that come in the ROM like
Voice Dialer
Music(dont use it)
IM
Mail
Amazon MP3
Talk
now im tired that everything i flash i need to go trew terminal to delete these apps can i like write a script that i can run an do all of these for me? (is that what scripts can do?) can some one help me out

I know that you CAN, I just don't know exactly how... but I'm interested as well, so here's hoping someone with the knowledge lays it on you.

so a specific script can be created?? now to find who can help me go about it

brios86 said:
ok now there is a few apps i dont like that come in the ROM like
Voice Dialer
Music(dont use it)
IM
Mail
Amazon MP3
Talk
now im tired that everything i flash i need to go trew terminal to delete these apps can i like write a script that i can run an do all of these for me? (is that what scripts can do?) can some one help me out
Click to expand...
Click to collapse
im about to leave right now, but when i get back i can write it up .. i usually delete VoiceDialer/VoiceSearch and Amazon everytime I flash a new ROM

IIRC, miketaylor00 posted up a script a while back to automatically remove a couple apps. I sent him a message with a link to this thread, but it looks like the board's Dominicano can help.

this would remove the apps:
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/app
rm VoiceDialer.apk
rm Music.apk
rm com.amazon*.apk
rm IM.apk
rm Mail.apk
rm Talk.apk
Just remove the .txt extension from the attachment

What's the difference between "rm" and "rm -r"?

uansari1 said:
What's the difference between "rm" and "rm -r"?
Click to expand...
Click to collapse
the -r switch will make it recursive, but since we're not doing it to directory, we don't need it ... i was gunna add some more to the script to remove the data/data/ directories for each of those apps up there, but i gotta look to see what they are first

thankx this is great i knew i wasent the only1 tired of doing that...

xidominicanoix said:
this would remove the apps:
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/app
rm VoiceDialer.apk
rm Music.apk
rm com.amazon*.apk
rm IM.apk
rm Mail.apk
rm Talk.apk
Just remove the .txt extension from the attachment
Click to expand...
Click to collapse
to remove the data of those apps:
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /data/data/
rm -r com.android.voicedialer
rm -r com.android.music
rm -r com.amazon.mp3
rm -r com.android.im
rm -r com.htc.android.mail
rm -r com.google.android.talk

wow even more thankz never new that one of removing the data, im sure this can come in helpfull to others. looking at the script i didnt know it could be that easy(atleast thats what it seems like to me)

brios86 said:
wow even more thankz never new that one of removing the data, im sure this can come in helpfull to others. looking at the script i didnt know it could be that easy(atleast thats what it seems like to me)
Click to expand...
Click to collapse
yup just gotta be careful with removing an app that could be dependent on another app

Is there anything stopping me from combining both into one shell script? I was going to make a script to do this myself because I am so sick of that damn teeter app! I will never play it and almost every ROM has it included.

Dyonas said:
Is there anything stopping me from combining both into one shell script? I was going to make a script to do this myself because I am so sick of that damn teeter app! I will never play it and almost every ROM has it included.
Click to expand...
Click to collapse
go ahead and combine them .. it should still work as long as you dont interleave the 2
also, the 2nd script doesnt need that mount command since we are messing with /data/ instead of /system/

I hand-typed the commands in console and received this error:
"mount: mounting /dev/block/mtdblock3 on /system failed: Invalid Argument
Any ideas?

theartar said:
I hand-typed the commands in console and received this error:
"mount: mounting /dev/block/mtdblock3 on /system failed: Invalid Argument Any ideas?
Click to expand...
Click to collapse
you dd a typo check again look between (mtdblock3 /system) you wrote (mtdblock3 on /system) <~~~ no good
this is:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

ok now that i got my phon working again i was having a SPL problem all done now thank god lol yes thank god i love my phone. anyways one question were do i put this script at??
also foundout MMS is save to remove and use a replacement app and you will work fine for those who use chop or handcent app

xidominicanoix said:
this would remove the apps:
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/app
rm VoiceDialer.apk
rm Music.apk
rm com.amazon*.apk
rm IM.apk
rm Mail.apk
rm Talk.apk
Just remove the .txt extension from the attachment
Click to expand...
Click to collapse
a noob question... how do you run a script? and what do you mean by removing .txt extension...
thank you!!!

Save his file to your SD card, and rename it to RemoveApp.sh instead of RemoveApp.sh.txt. To run it, you can go into Terminal Emulator and type "sh /sdcard/RemoveApp.sh", substituting the correct file path where you have saved the script.

uansari1 said:
Save his file to your SD card, and rename it to RemoveApp.sh instead of RemoveApp.sh.txt. To run it, you can go into Terminal Emulator and type "sh /sdcard/RemoveApp.sh", substituting the correct file path where you have saved the script.
Click to expand...
Click to collapse
or to save you time get GScript in the market

Related

trying to delete apks off ext3

ok so im trying to get rid of some apk that r no longer on my g1 they r just on my ext 3. i went into terminal and tried 2 sets of sripts. the 1st one was:
su
cd /system/sd
ls app
rm pk blah blah
basically when i ran this i got no such file in directory message. so i searched and tried this next:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /ststem
it said: device or resource busy
can anyone help? im on cm 3.6.8.1 with ext3. i dont have my pc with ubuntu on it it crashed.
do rm *.apk to remove all of them
alritewhadeva said:
do rm *.apk to remove all of them
Click to expand...
Click to collapse
yea i know that command but im just trying to get rid of one not all
pistol4413 said:
yea i know that command but im just trying to get rid of one not all
Click to expand...
Click to collapse
its case sensitive remember that..ur typing it wrong. not a mounting issue
su
cd /system/sd/app
ls
rm *APPNAMEASLISTEDABOVE*
Jonno12345 said:
su
cd /system/sd/app
ls
rm *APPNAMEASLISTEDABOVE*
Click to expand...
Click to collapse
Umm I tried that. I said I tried it in the 1st post. And I'm 100 percent sure I typed it right I wrote down the name on a seprate peice of paper and checking it twice.
In your first post, you're listing all the applications in the app folder, but then trying to remove them from the /system/sd folder. You need to cd into the app folder, then do the rm command, or do rm ./app/*APP NAME*
Atleast try following my steps before concluding they are not right .
Ok tried it ur way and same results:
Su
Cd /system/sd
Ls app
Rm com.bg.smsbk.apk
Rm: can not remove 'com.bg.smsbk.apk' No such file or directory
And like I said I tried this 1st b4 I posted, and I checked the spelling
You're missing a VERY important part of my instructions
su
*********** cd /system/sd/app **************
That /app part isn't for show, that is necessary.
Then use ls, not ls app
Follow my instructions to the letter, and you'll find a much better success rate .
Even better, tell me the name of the app and I can tell you exactly what to type
Lol I truer ur commands didn't work same result. And by the way cd/system/sd/app is the same as this:
Cd /system/sd
Ls app
My command involve a few extra sets but either way they r the same as urs
pistol4413 said:
Lol I truer ur commands didn't work same result. And by the way cd/system/sd/app is the same as this:
Cd /system/sd
Ls app
My command involve a few extra sets but either way they r the same as urs
Click to expand...
Click to collapse
try going into the recovery console
<enter>
mount /system
rm /system/sd/app/xxxxxxxxxx.apk
reboot
if you can't get anything else to work then download root explorer and delete the .apk using it.
pistol4413 said:
Lol I truer ur commands didn't work same result. And by the way cd/system/sd/app is the same as this:
Cd /system/sd
Ls app
My command involve a few extra sets but either way they r the same as urs
Click to expand...
Click to collapse
What he's saying is that when you type rm blah, you are trying to remove something from /system/sd/ when you need to be removing it from /system/sd/app therefore, you need to cd /system/sd/app to have the plain vanilla rm, otherwise, you need to rm app/blah.
I hate typing in the full names so what I do, is take a specific part of the apk filename that no other file has i.e.
If i was trying to delete com.flargh.apk, I would type
cd /system/sd/
ls app
rm app/*flargh* <- these asterisks are necessary, they are wildcards (just if you didn't know, I didn't want to clarify with another post down the line)
This way, its harder to mess up as you only need to type in a small portion of the actual filename.
h.nocturna said:
I hate typing in the full names so what I do, is take a specific part of the apk filename that no other file has i.e.
If i was trying to delete com.flargh.apk, I would type
cd /system/sd/
ls app
rm app/*flargh* <- these asterisks are necessary, they are wildcards (just if you didn't know, I didn't want to clarify with another post down the line)
This way, its harder to mess up as you only need to type in a small portion of the actual filename.
Click to expand...
Click to collapse
Great tip. I love it. Makes things so much simpler. Works like a charm.
@OP, your initial problem is that you were trying to do this from terminal, which is impossible if you are on apps2sd because the ext3 partition is in use whenever the phone is booted normally. therefore, you MUST reboot into recovery to mess with your ext3 partition in ANY WAY.
-BMFC
pistol4413 said:
Lol I truer ur commands didn't work same result. And by the way cd/system/sd/app is the same as this:
Cd /system/sd
Ls app
My command involve a few extra sets but either way they r the same as urs
Click to expand...
Click to collapse
This is not the same thing at all, this is:
cd /system/sd
You're now in the /system/sd folder
ls app
You're listing everything in the /system/sd/app folder
rm *app*
You're still in the /system/sd folder, so it's trying to remove the file from there, NOT the app folder you listed. My method would put you in the correct folder. You can use your method, but before the rm command, type 'cd app', that would work, but it adds unnecessary steps.

ADB/Term app install/uninstall

I'm having trouble finding a definitive way of uninstalling/installing apps onto my phone. this is what I've found.
Either through terminal or ADB:
mount -o rw,remount /system (another thread had mount -o rw,remount -t yaffs, /dev/block/mtdblock3 /system... or something along those lines)
rm -r /system/app/appname.apk
That only seemed to work for com.amazon.mp3.apk.
I've used astro file manager to find out the app names, for example on CM 4.0.4 he has the Work email, which I don't use. Under astro it is called just "Mail". I tried removing mail.apk and i've tried removing com.htc.android.mail.apk (which is what the app says under astro) but I cannot remove that one, nor any of the easier ones (camera.apk etc...). Only amazon mp3 was removed.
Am I missing something?
Also, installing apps. I am having trouble finding out how to push your own.
Any help with these?
Thanks
Easiest way would be to get root explorer off the market.
Or with adb do
Code:
adb remount
adb shell
rm /system/app/xxxx.apk (or if that doesn't work put -r after rm
In recovery console do
Code:
mount system
rm /system/app/xxx.apk (or -r if doesn't work)
Thats how i remove system apps.
same thing...
I tried rebooting into the console and trying this, here's what I got.
# Mount System
# rm /system/app/com.amazon.mp3.apk (this one works)
# rm /system/app/mail.apk
rm: cannot remove '/system/app/mail.apk' : No such file or directory
# rm /system/app/com.htc.android.com.apk
rm: cannot remove '/system/app/com.htc.android.com.apk' : No such file or directory
the others don't. I am finding the root address the same as with amazon mp3.
I am running CM 4.1.9. I tried it with 4.0.4 but I get the same issue. Only app that comes out is the amazon mp3. I am trying to delete the Work Email, Voice Dialer and push in the My Faves.
Any ideas what I am doing wrong?
Filenames are case sensitive.
/system/app/Mail.apk
/system/app/Camera.apk
Go to your apps directory to see the filenames with
Code:
cd /system/app
ls
Forum search adb explorer
AdamPI said:
Filenames are case sensitive.
/system/app/Mail.apk
/system/app/Camera.apk
Go to your apps directory to see the filenames with
Code:
cd /system/app
ls
Click to expand...
Click to collapse
Ahhh, Case sensitive. I didn't realize. Thanks for the info. You are the man!!!!!!!!
That was exactly it.
Thanks again!!!!!

Command for removing peep and twitter apks from hero?

So these to apps slow down hero a lot, and i wanted the command for console(rec mode) to remove them.
can't you remove them with rm from shell?
jackslim said:
can't you remove them with rm from shell?
Click to expand...
Click to collapse
you just need to remount the system with RW permissions.
mount remount,rw -o yaffs2 /dev/block/mtdblock3 /system
then run rm commands to get rid of it
search just about any hero thread in development for "peep" and you'll find adb instructions........

Where are all my APk's

Just went from Cm To Drawg. A change is as good as a rest.
All my Apk's have gone, when i go to the market, there showning as installed.
Which means i can't un-installed.
Can i use the console. and if so what comands should i use.
thanks in advance.
dj westie said:
Just went from Cm To Drawg. A change is as good as a rest.
All my Apk's have gone, when i go to the market, there showning as installed.
Which means i can't un-installed.
Can i use the console. and if so what comands should i use.
thanks in advance.
Click to expand...
Click to collapse
This will remove all apps so, I hope you didn't install hundreds
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm /system/sd/app/*
rm /system/sd/app-private/*
reboot recovery
Now wipe your dalvik-cache, and you should be good to go
Getting ;-
mount Can't find /dev/block/mtdblock3/system in /proc/mounts
is there another way?? Or should i just keep trying??
Now getting invalid Argument???
Only App i really want back is Download crutch.

[GUIDE] How to Remove Pre-Installed Apps for FREE

First, you need to install the drivers:
http://www.samsung.com/us/support/d...R&prd_mdl_name=SPH-D700&prd_ia_sub_class_cd=P
Then you must be rooted:
http://forum.xda-developers.com/showthread.php?t=775110
Next, get the most current SDK:
http://developer.android.com/sdk/index.html
Extract the zip and put it where it's easiest for you to get to on Command Prompt. I put it in my C:\ for extremely easy access.
Now, open up Command Prompt and put in these commands in order
1.
Code:
cd C:\android-sdk-windows\tools
2.
Code:
adb devices
3.
Code:
adb shell
4.
Code:
su
5.
Code:
mount -t rfs -o remount,rw /dev/block/stl9 /system
6.
Code:
cd /system/app
7.
Code:
ls
Now you should see a list of all the pre-installed Apps on your device. To remove these apps you must use this command:​
Code:
rm "app_name.apk" or rm "odex_name.odex"
Here is a list of all the pre-installed apps on the stock Epic ROM and an explaination for most of them:
http://forum.xda-developers.com/showthread.php?t=773142
-------------------------
Here is my suggested list to use:​
Code:
rm amazonmp3.apk[LEFT]rm Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk[/LEFT]
rm MediaHub.apk
rm nascar09-prod-release.apk
[LEFT]
rm sfl-prod-release.apk
[LEFT]
rm SN28-1092-sprint-signed.apk
[LEFT]
[LEFT]rm SprintTV.apk
[LEFT]rm SprintTVWidget.apk[/LEFT]
[/LEFT]
[/LEFT]
rm SprintZone.apk
[LEFT]rm MobileAP.apk - Only if you don't pay for the $30 hotspot[/LEFT]
rm MobileAP.odex - Only if you don't pay for the $30 hotspot
[/LEFT]
[/LEFT]
Titanium backup is easier and less time consuming then messing with ADB and is free.
Eh, not really. ADB is much more resourceful and has alot more uses and options if you learn how to use it. This is only one of it's uses. Titanium Backup is just a waste of space IMO. It is very limited on the free version.
Or you can use SDX App Removal if your interested in only removing the preinstalled apps (must be rooted).
Sent from my SPH-D700 using XDA App
At the expense of sounding like a noob, which I guess I am when it comes to Android, I'm getting a real-only error. I rooted with noobnl and Titanium Backup tells me I'm rooted. What might I be doing wrong?
Try using this as the mount command:
mount -t rfs -o remount,rw /dev/block/stl9 /system
Or better yet use one of the GUI options unless you are familiar with linux and save the headache. If all you want to do is remove apps there are far easier methods that are less time consuming. Titanium backup and SDX removal tool are both free.
Sesquipedalian said:
At the expense of sounding like a noob, which I guess I am when it comes to Android, I'm getting a real-only error. I rooted with noobnl and Titanium Backup tells me I'm rooted. What might I be doing wrong?
Click to expand...
Click to collapse
Hmmm see I got that error too when I first did it, but then I did it again and it worked perfect lol...
Mine is Wildfire, I have some issues:
Can not do this:
mount /dev/block/mtdblock4 /system
or
mount -t rfs -o remount,rw /dev/block/stl9 /system
But actual there exists a directory /system/app, in which I can see all the .apk and .odex files. When I tried to delete a file, it says that 'rm failed for File-Name, read-only file system'
What should I do? thanks
xirochanh said:
Mine is Wildfire, I have some issues:
Can not do this:
mount /dev/block/mtdblock4 /system
or
mount -t rfs -o remount,rw /dev/block/stl9 /system
But actual there exists a directory /system/app, in which I can see all the .apk and .odex files. When I tried to delete a file, it says that 'rm failed for File-Name, read-only file system'
What should I do? thanks
Click to expand...
Click to collapse
Well this is for the Samsung Epic...so i have no idea what you have to do
Whosdaman said:
Mine is Wildfire, I have some issues:
Can not do this:
mount /dev/block/mtdblock4 /system
or
mount -t rfs -o remount,rw /dev/block/stl9 /system
But actual there exists a directory /system/app, in which I can see all the .apk and .odex files. When I tried to delete a file, it says that 'rm failed for File-Name, read-only file system'
What should I do? thanks
Click to expand...
Click to collapse
Now I can mount, to over come the read-only problem, however whenever I delete a file, it says that: rm failed for filename.apk, Directory not empty
You guys have any advice? thanks
xirochanh said:
Now I can mount, to over come the read-only problem, however whenever I delete a file, it says that: rm failed for filename.apk, Directory not empty
You guys have any advice? thanks
Click to expand...
Click to collapse
hmmmm idk....thats seems really strange. Maybe its something you cant delete
I tried to reboot in HBOOT/Recovery/ Partition Menu, then mount /system. Then I could remove apps in adb shell successfully. can anyone confirm that doing like this is ok?
My wildfire was rooted with unrevoked3
If it works then it should be fine
Sent from my SPH-D700 using XDA App
This is confirmed to still work with the DI07 update
My noob question is I am using titanium backup to remove the sprint bloatware like media hub and it looks like the program removes it but when I exit titanium it is still on the phone.
Aridon said:
Titanium backup is easier and less time consuming then messing with ADB and is free.
Click to expand...
Click to collapse
Titanium backup is the mark of the noob in my opinion.
thanks, i had been searching around for the adb commands to mount the system r/w so i could remove the bloat.
SDX Stock App Removal is tops in my opinion.
Quick, simple, and allows for back-ups.
And I also don't think Titanium is the "Mark of the noob". It would be more like the "Mark of the ADB is unnecessary for stock application removal"
Also I don't think this should be in development. And if you know ABD commands you should know that.
This thread is okay....but sdx..and root uninstaller are awsome. Thanks for this guide though my friend very useful info for those that want to experiment with adb....
Sent from my Nexus S 4G using XDA Premium App
More options is a good thing. This is also helpful for the noobs who want to get their feet wet with unix/linux shell commands.

Categories

Resources