[Q] [help] how to delete app's data by script - Android Q&A, Help & Troubleshooting

I am using sgs with miuiv4 by andy,
the media storage got duplicated every boot,
i have an idea that every time clear media storage's data at boot before scanner action.
i tried to use init.d with an script i created in /data/local/userinit.sh
i tried
pm clear com.android.providers.media,
it works in adb, but when i try it in terminal emulator, it keep showing me "segmentation fail"
any idea to achieve this tweak, i am just a newbie. help

I am trying to do the same thing, except I put it into GScript.
Also segmentation fault.
Anyone has any ideas?

i have bought an i9100... so... say bye to my i9000~

Does anyone have a solution to this problem?
I'm having the same problem.
Running "pm clear" by adb shell works normally.
But when I run via "sh script.sh" does not work.
It seems that running does not find the package.
If I include in the script command "pm list packages com.myapp" nothing is returned.

Related

use GScript Lite to view bootanimation?

Hey gang,
I am trying to create a script (using GScript Lite) that will preview the boot animation currently loaded. I am running 2.1 leak v3 and don't have root yet. I made a script with only one line like this: "adb shell bootanimation" and saved it. When I try to run the script I get the "permission denied" error. I guess I need root to run the command locally on the phone. Odd though.... because I can run the command from my computer connected via USB and it works just fine. Can anyone explain why its not working locally when I run the script? Surely it does not trigger root access when running this command from a computer.... does it?
Curious....
Also, is there another way around this so I can accomplish previewing the boot animation on my phone without external input? I searched the market and installed the app called "Boot Animation Preview Lite". It required AndExplorer to be installed to work.... but it never did actually work. Only Force Closes on every attempt.
synaptyc said:
Hey gang,
I am trying to create a script (using GScript Lite) that will preview the boot animation currently loaded. I am running 2.1 leak v3 and don't have root yet. I made a script with only one line like this: "adb shell bootanimation" and saved it. When I try to run the script I get the "permission denied" error. I guess I need root to run the command locally on the phone. Odd though.... because I can run the command from my computer connected via USB and it works just fine. Can anyone explain why its not working locally when I run the script? Surely it does not trigger root access when running this command from a computer.... does it?
Curious....
Also, is there another way around this so I can accomplish previewing the boot animation on my phone without external input? I searched the market and installed the app called "Boot Animation Preview Lite". It required AndExplorer to be installed to work.... but it never did actually work. Only Force Closes on every attempt.
Click to expand...
Click to collapse
Have you tried
Code:
adb shell bootanimation
I doubt it needs root to be run but that will show you the boot animation and it will keep looping until you stop the command which on windows is control C
lol.... did you even read my post?
rofl
synaptyc said:
lol.... did you even read my post?
rofl
Click to expand...
Click to collapse
Lol probably not...
when running it from the phone where is it running from?
also if you are running it from phone it doesn't need the adb shell part
it should be
Code:
bootanimation
^^ I tried this from a terminal but it doesn't work unless I give the terminal su privilages.
so there might not be a way to do this on the phone without root privilages.
Sorry I couldn't be any help.
Its all good t2noob. Thnx for the info... food for thought.
Time to write an app for that =)
results so far:
I created a GScript called "bootscreen" (because I am using a bootscreen with sound and not a "bootanimation.zip"
I checked 'Needs SU?' because I now have root
Then I added the line: bootanimation
All goes well, and I can see/hear my bootscreen BUT I can't end it.
It continually loops like it is supposed to.
Can anyone tell me how to kill the bootanimation once it has been called via GScript Lite?
Things I have tried:
hitting the BACK, HOME, MENU, END/OFF buttons. really every button on the phone.
tapping the place on the screen where I have a "QuitIt" widget that will kill all running apps
The phone will accept screen input because I can tap where certain apps are and tell that they are launching. IE: phone, music player, etc.
I was even able to reboot the phone using Quick Boot just because I knew where the on-screen buttons were to make it reboot.
There seems to be no way to kill the bootanimation except to pull the battery.
Maybe I could create a GScrpit that will kill it, then just know where it is on the screen behind the animation?
Any tips?
EDIT: I created a script like this but it still didn't kill the bootanimation (it did run correctly with the sleep thing though)
Code:
bootanimation
sleep 10
pkill bootanimation
pkill boot1.gif
pkill boot2.gif
This is how I've done it through gscrip:
Code:
TIMEOUT=20
( bootanimation & sleep
$TIMEOUT; kill $! 2>/dev/null )
you can change the timeout duration to suit your liking (it's in seconds).
Regards,
Yahya

android.process.acore process has stopped

running vegan and i keep getting this message. I think my wife was using it and maybe the battery died? not sure. any thoughts?
thanks
I get this about every 2 weeks. I boot into clockwork, reset to defaults, then restore from backup.
sent from my g-tablet using tapatalk
i got it. found the answer in the android general forums. You have to delete a database and it clears it up.
Steps
Posting the steps you took might be a little more helpful to anyone reading your thread.....
gpzjack said:
i got it. found the answer in the android general forums. You have to delete a database and it clears it up.
Click to expand...
Click to collapse
Which data base?
Do you mean perform a clear cache/data?
or are you mentioning the contact database sync from gmail?
from another post:
I noticed at least two people in this thread have had this problem. The following worked for me... At one point I started getting this error also. Driving me crazy! Could not bring up the keyboard, and the message would pop like every 5 seconds. I searched and found this post (thanks and credit to KinkyMunkey):
process com.android.acore FC and how i fixed it
I didn't want to wipe data, so I tried it. I couldn't use ES File Explorer for this, but Root Explorer worked great!
The problem is a corrupt contacts sqlite database. As the referenced post says, you'll be able to tell if thats the problem when there is a .db-journal file in the folder. The folder is /data/data/com.android.providers.contacts/databases/ *Note* this is not the data folder in sdcard, but the data folder in root (/).
Just delete the databases folder in /data/data/com.android.providers.contacts and restart. The contacts database will be rebuilt and re-synced.
This has worked for me twice (thank goodness). I don't know what causes the contacts DB to get messed up... it wasn't a drained battery for me.
Thank you so much, this worked for me!
gpzjack said:
from another post:
I noticed at least two people in this thread have had this problem. The following worked for me... At one point I started getting this error also. Driving me crazy! Could not bring up the keyboard, and the message would pop like every 5 seconds. I searched and found this post (thanks and credit to KinkyMunkey):
process com.android.acore FC and how i fixed it
I didn't want to wipe data, so I tried it. I couldn't use ES File Explorer for this, but Root Explorer worked great!
The problem is a corrupt contacts sqlite database. As the referenced post says, you'll be able to tell if thats the problem when there is a .db-journal file in the folder. The folder is /data/data/com.android.providers.contacts/databases/ *Note* this is not the data folder in sdcard, but the data folder in root (/).
Just delete the databases folder in /data/data/com.android.providers.contacts and restart. The contacts database will be rebuilt and re-synced.
This has worked for me twice (thank goodness). I don't know what causes the contacts DB to get messed up... it wasn't a drained battery for me.
Click to expand...
Click to collapse
I also had the "android.process.acore process has stopped" problem. I seem to have fixed it by going to "Manage Apps", "Running", "Contacts Storage", "Clear Data", then same process for Contacts Sync Adapter. Seems to have resolved problem...so far.
yup the contacts storage got corrupted -> most likely you created an empty contact in the contacts app by mistake. Someone should sticky this - i see one of these threads daily haha. Its a pretty common problem.
many time that error (fc) is due to a contact with blank first and last name as the contact database uses them as index. if you have blanks the probem will keep returning.
thanks for the tip - seems to have helped me out of the
...acore... problem
Mind you, I **Never** touched the contacts app in any
way whatsoever.
The corruption happened "spontaneously"
After playing (it is *only* suitable for play) with android
for a few weeks now, you know what, android is CRAP
Cant get to Manage Apps
Everytime I go to settings the damn thing pops up. Cant get to anything to clear the data base. Dont have root explorer and cant find that in the file manager I do have.
Any help?
cassycan said:
Everytime I go to settings the damn thing pops up. Cant get to anything to clear the data base. Dont have root explorer and cant find that in the file manager I do have.
Any help?
Click to expand...
Click to collapse
I had this problem just tonight. Thanks to GPZJack for posting the file to delete. For those of you who can't launch programs because of the "force close" dialog, here is how to do it without that.
1) Install the android developer kit on your PC. You will need the program adb (short for android debugger). I tried to post a link to the instructions, but am too noobish for the forum to allow me to post links. Just google android sdk install
2) Attach gtablet to computer using usb cable
3) [Assuming windows] Launch a command window. cd to tools directory under the android sdk install directory.
4) type the command "adb devices" (without quotes) to verify that adb sees your tablet. If not, you need to install the correct usb drivers. Find help with google gtablet usb driver install
5) type the command "adb shell" (without quotes) This will connect you to the tablet and provide you with a unix shell prompt #
!! Careful with this next command. It will delete the databases directory. Make sure you type the line correctly so that you don't accidentally delete something else.
6) #rm -r /data/data/com.android.providers.contacts/databases
7) #reboot
And your tablet should reboot and work.
Hope that helps!
Norm Minske said:
I also had the "android.process.acore process has stopped" problem. I seem to have fixed it by going to "Manage Apps", "Running", "Contacts Storage", "Clear Data", then same process for Contacts Sync Adapter. Seems to have resolved problem...so far.
Click to expand...
Click to collapse
I was unable to see the folder described in other peoples solutions, your solution of clearing data through the settings application worked great for me on brilliant corners 1.3.1. Thanks.
simuloid said:
I had this problem just tonight. Thanks to GPZJack for posting the file to delete. For those of you who can't launch programs because of the "force close" dialog, here is how to do it without that.
1) Install the android developer kit on your PC. You will need the program adb (short for android debugger). I tried to post a link to the instructions, but am too noobish for the forum to allow me to post links. Just google android sdk install
2) Attach gtablet to computer using usb cable
3) [Assuming windows] Launch a command window. cd to tools directory under the android sdk install directory.
4) type the command "adb devices" (without quotes) to verify that adb sees your tablet. If not, you need to install the correct usb drivers. Find help with google gtablet usb driver install
5) type the command "adb shell" (without quotes) This will connect you to the tablet and provide you with a unix shell prompt #
!! Careful with this next command. It will delete the databases directory. Make sure you type the line correctly so that you don't accidentally delete something else.
6) #rm -r /data/data/com.android.providers.contacts/databases
7) #reboot
And your tablet should reboot and work.
Hope that helps!
Click to expand...
Click to collapse
i manage to get tru the issue on adb shell by installing usb deview, n my command bar alrdy shown my device no. after typing adb devices but aft adb shell, came $ and not #, is there any different?
okay i had mine miracle- ly and not realising it done, my force stop no longer appear after downloading the latest busybox apps.=)
Hi - I was getting the acore error too. but I went ahead & did an nvflash. The error is still popping up. Any ideas?

[Q] "Operation not permitted" trying to mount extSD as intSD

Hi, I've been trying to move all my game data from my internal SD card to my larger external SD card with no joy.
I have used condi's AIO tool to install init.d support, which reported as successful, but when I follow obicom's instructions as listed in POST #43 of this thread http://forum.xda-developers.com/showthread.php?t=1490116&page=5
I repeatedly receive the message "Operation not permitted."
I have used both ADB Shell and Terminal Emulator with the same result.
I'm obviously doing something wrong as other people appear to have had success with these instructions, I just don't know what.
Here's what I've done: (on rooted ICS from condi's AIO tool)
Installed init'd support "successfully"
Moved all data from sdcard/Android/data over to sdcard2/game_data
In ADB Shell/Terminal Emu. entered the following line;
mount -o bind /sdcard2/game_data /sdcard/Android/data
and this is where I get the "Operation not permitted" message.
Any ideas?
Once you're in shell, before running the mount command, run the command 'su' first (without the quotes). Your prompt should change from $ to # and try running the mount command again.
Explained: In most Linux systems, unless the fstab has been specifically setup to do it with the user option, filesystems can only be mounted by root. In rooted versions of Android, the normal user can elevate into a root prompt with su, then allowing you to mount and unmount any filesystems.
Ahaaa
Awesome! Can't believe it was something so simple, thanks, and thanks for explaining the reason.
I must have somehow totally missed the "su" instruction in the other thread.
Half of my games work, the other just seem to need re-installing which is no big drama.
Again, thanks, it's much appreciated mate.
Script?
agc93 said:
Once you're in shell, before running the mount command, run the command 'su' first (without the quotes). Your prompt should change from $ to # and try running the mount command again.
Explained: In most Linux systems, unless the fstab has been specifically setup to do it with the user option, filesystems can only be mounted by root. In rooted versions of Android, the normal user can elevate into a root prompt with su, then allowing you to mount and unmount any filesystems.
Click to expand...
Click to collapse
Hi, is there a way I can create a script (or the like) that would do this, and other similar directory changes, at boot?
At present I need to enter these manually each time the tablet starts, which isn't too much of a drama for me but when other people use it they end up downloading the data all over again when they start a game.
Thanks
There is an app available on Google Play called Script Manager (which can be used to create scripts to run at boot as su (which mount command require), which should do what you need. You'll need to use a plain text editor (I believe there is one included with Script Manager) to enter each of the mount command you want to run on a separate line. Then set the file to executable (chmod +x scriptname), and add it to Script Manager.
Note that I haven't used it in a while, so follow whatever instructions Script Manager gives you. They're probably more up to date.
agc93 said:
There is an app available on Google Play called Script Manager (which can be used to create scripts to run at boot as su (which mount command require), which should do what you need. You'll need to use a plain text editor (I believe there is one included with Script Manager) to enter each of the mount command you want to run on a separate line. Then set the file to executable (chmod +x scriptname), and add it to Script Manager.
Note that I haven't used it in a while, so follow whatever instructions Script Manager gives you. They're probably more up to date.
Click to expand...
Click to collapse
Okay thanks, yet again, I'll give it a try today.
Operation not permitted
Hi,i wanted to change my mac address on phone and even with that su command i get "operation not permitted" (my phone is rooted)...even apk named overclock for android could not grant root acces...in root checker my phone is rooted(and i have been rerooting it but still same).AND THERE IS NO FIX ON INTERNET

[Q] Commands that work in terminal, but not when put in script

Hi everyone,
I am having a general conundrum that is really setting me back. My device(s) are my HTC One (rooted) and and CS968 (rooted) mini-pc. I've tried the following on both devices and always get the same thing. I don't think its device specific:
I am trying to install an APK. When I go into Terminal Emulator and get su permissions, I type in the following command "pm install /sdcard/directory/of/apk/target.apk" and it works, success, the apk is installed.
If I write a .sh script with the EXACT same syntax, I always get the infamous "INSTALL_FAILED_INVALID_URI" error. I cannot for the life of me figure out why.
Yes, I have searched every corner of this forum and google for solutions to this problem. They all end with the conclusion that you need to re-flash your rom (???) which seems very improbable to me. What makes my case different is that, like I said, the command works just fine when manually entered into Terminal Emulator, but when executed from a script, is when I get this bizzare error. I am at my wits end.
If anyone could shine some light on this for me I would greatly appreciate it.
Thank you

How do recover data from unrooted and boot-looped LG L9-II?

Dear users,
I read multiple threads throughout internet and couldn't find working solution. My lg with kitkat 4.4.2 had lagged so I removed battery. After this phone is boot-looping with startup animation forever.
I can explore files with adb shell when phone is in recovery mode but don't have access to dalvik-cache. Command "su rm -rf /system/data/dalvik-cache" gives "permission denied nor "adb backup -all" cause "unlock your device and confirm...".
I cannot root phone by copying SuperSu files into /system/app. The command "su cp.. " gives no answer and later when exploring /app there's no SuperSu program.
I was trying to explore through sudo nautilus on Ubuntu during using one of rooting tutorial but the phone just disappears in the list of mounted devices.
I have important data like phone contacts, messages and some pictures inside phone memory. I didn't backup all of them formerly.
Any ideas?
likkufri said:
Dear users,
I read multiple threads throughout internet and couldn't find working solution. My lg with kitkat 4.4.2 had lagged so I removed battery. After this phone is boot-looping with startup animation forever.
I can explore files with adb shell when phone is in recovery mode but don't have access to dalvik-cache. Command "su rm -rf /system/data/dalvik-cache" gives "permission denied nor "adb backup -all" cause "unlock your device and confirm...".
I cannot root phone by copying SuperSu files into /system/app. The command "su cp.. " gives no answer and later when exploring /app there's no SuperSu program.
I was trying to explore through sudo nautilus on Ubuntu during using one of rooting tutorial but the phone just disappears in the list of mounted devices.
I have important data like phone contacts, messages and some pictures inside phone memory. I didn't backup all of them formerly.
Any ideas?
Click to expand...
Click to collapse
Could you elaborate on "disappears?" Usually if something is present and suddenly disappears in lubuntu, that means the connection was broken (either physically or by software, such as when switching drivers by running a command). Anyway, have you tried letting it sit for a day or something? I figure the reason it "lags" might potentially affect booting time.
It's also helpful to know what data you want out of it. Some things need root, some things don't need root. If all you want is file X in user space, I imagine that'd be infinitely easier than trying to get a random bootloader setting.

Categories

Resources