So I have implemented all the backup method following official android backup tutorial :http://developer.android.com/guide/topics/data/backup.html
But After I am done with everything, I cannot test it! The Android website says to use bmgr and use commands such as "adb shell bmgr run" etc, but I have no idea what this means...
I am using Eclipse to develop Android apps, and I am using real Samsung Galaxy Devices to test my apps. I am also backing up 1 file from the internal storage.
So how do I force the back up? Where can I write the command line (i can open DDMS)? What and where is this bmgr thing?
And does anyone know how long it takes for devices to actually backup data? Backing up data doesn't seem to happen immediately (if it happens at all) after you call:
BackupManager bm = new BackupManager(this);
bm.dataChanged();
TY
The solution to this problem. You need to find adb.exe file in the Android ADK folder. It is inside platform-tools folder. And then you have to use terminal to go to the folder that has adb so that when you do ls, adb appears. Then you do the command but with ./ in the front
For example:
./adb shell bmgr run
instead of just adb shell bmgr run.
First check whether your device is connected using:
./adb device
From here you can force backup and restore for your app.
Related
Could someone tell how to run cloned (dual) application via adb shell. The smartphone has MIUI 11 and the app is TelegramX, for example. Application clone emulator is by default.
I get the original application when I try to run the app via:
adb shell
monkey -p org.thunderdog.challegram 1
The package list tells only this point:
package:org.thunderdog.challegram
And no hint to the cloned one.
Meanwhile, directory to the clone application is:
/data/user/999/org.thunderdog.challegram
instead of
/data/data/org.thunderdog.challegram that original has. Prpbably, it can be helpfull somehow.
I can't find anywhere documentation about how Dual apps are implemented and how to run such apps through adb.
Thanks in advance!
adb shell
Once you’re in an ADB shell, enter the following command:
settings get secure clone_app_list
If you are already using the App Twin feature, then you should see either one or two package names returned with this command. If you aren’t using this feature, this string will be empty. Now, we will either append to the existing list or create a new list of apps to clone.
settings put secure clone_app_list "PACKAGE#1;PACKAGE#2;PACKAGE#3"
Source: [1]: https://www.xda-developers.com/how-to-clone-any-application-with-emuis-app-twin-feature-no-root/
I'm debugging my android app in Android Studio using a real android device and. I see that the Sqlite db path is
/data/data/com.my_app/databases/data1.db
I want to remove it. By that path doesn't exist when try to find it by a file manager. And, of course, this isn't working:
adb -e shell rm /data/data/com.my_app/databases/data1.db
adb server is out of date. killing...
* daemon started successfully *
error: device not found
So how can I remove it and why isn't it visible in my smartphone?
why isn't it visible in my smartphone?
Because it is on internal storage, which you do not have access to, except on emulators and rooted devices.
And, of course, this isn't working:
That is some separate problem with adb running on your machine.
So how can I remove it
If you want to completely clear your app's data (databases, SharedPreferences, and other files) on internal storage, use the Settings (e.g., Settings > Apps > (your app) > Clear Data on Android 4.x/5.x).
If you specifically want to get rid of this file on an emulator, the command you tried should be fine. I suggest restarting the emulator.
If you specifically want to get rid of this file on production hardware, you will need to use run-as:
adb shell run-as com.my_app rm /data/data/com.my_app/databases/data1.db
You can't reach that directory if your device isn't root . For change or modify system files you must have root access .
A few days ago I received complaints from several customers who told me that "adware is installed automatically on your device Krono NET K5". I made invesigar and found a few apk on / system / app that had different permissions to the usual "rw-r - r--". I could erase the few simple steps in a shell:
adb shell "su -c 'mount -o rw, remount /'"
adb shell "su -c 'rm /system/app/156.apk'"
adb shell "su -c 'rm /system/app/Launcher0607wxDjbOa.apk'"
adb shell "su -c 'rm /system/app/Sync.apk'"
adb shell "su -c 'rm /system/app/SettingProvider.apk'"
(Note that a suspect name as there is a apk using the system call SettingsProvider.apk with letter s)
So far everything worked properly, however there is a apk which is the main cause of all adware and causing the discharge cone apk other battery savers, system cleaners, among others. This application is:
"/system/app/providerdown.apk" Permits "rwsr-sr-x"
I tried to remove it by the above method, I tried to change the permissions to remove it and it has not worked. I tried to install a recovery to eliminate apk thence Aroma File Manager (CWM, TWRP) MTK but this device does not support any custom recovery for devices MTK.
Any idea? Thanks in advance (sorry for my bad english)
I have same problem. You will have to be rooted for this, but i guess you have root because of that code you wrote, and the fact that app somehow gains root access and installs itself in system. Only thing I did to make things easier is:
Download Avast to your phone.
Download Clean Master to your phone and with Clean master make backup of your avast apk.
Go to your stock recovery. I used an app from google store to boot to recovery but any way is good.
Clean cache and do a factory reset.
Boot the device.
DO NOT CONNECT DEVICE TO ANY NETWORK.
Just skip all the stuff like login to your google account and other settings.
Find your Avast apk in the sd card and install it.
Turn on firewall and block all acces to TimeService-that is the name that apk uses when seen from android system.
Go to android system and disable time service. It is probably version 1.1.6
You will still have malware in your device but it wont make mess anymore.
I would like the permanent solution too.
I want to write a small tool to move apps to SDcard.
I found the movePackage()-method in Android Open Source and reflect the method. I failed because this method need com.android.PERMISSION.MOVE_PACKAGE which I cannot get. So I want to using shell script to do this for rooted devices.
But I don't actually know what happened in the movePackage()-method. So I can't write the correct script.
Could you please tell what happened inside the Android when a app is moved to SDcard? Can I do this with program?
I'm not sure If I understand you, but on rooted device you can use adb.
For example:
adb push /home/username/Desktop/app.apk /sdcard/app.apk
Also you can do this (for removing):
adb shell rm /sdcard/app.apk
If you want to install:
adb install /home/username/Desktop/app.apk
I wanted to delete my custom apps on the Android emulator in Eclipse. I followed this guide and encountered the same behaviour as described in this question. I also tested the root access the same way Arsalan mentioned in his first answer and got the same result.
I would like to try if Vyomas approach works, but I don't know the command for deleting an app.
Can anyone help?
I am assuming you are getting "rm failed for minesweeper.apk, Read-only file system"
If that's the case, then you could always press "page up" to bring up the menu in the homescreen and uninstalled it through Settings -> applications -> Manage Applications
Or you could keep going comando style and use this from androidkit, worked for me:
Using adb shell :
Important: The device has to be unplugged from USB if you are trying to uninstall from the emulator, else emulator should not be open and device needs to be plugged in the USB of the PC if you are trying to uninstall from the G1 Device. If either of them are not connected the adb shell command will not work.
Go to the shell and making sure adb is in PATH:
Go to shell (from cmd->adb shell or directly through a terminal)
#
#cd data
#cd app
#cd ls
#rm com.company.product.apk
Can you not just reset the device on startup if you want it removed? If your using the Eclipse add-on to use the emulator just select the box to wipe user data before you launch?
Si