I am currently developing directly on my device using an ide app called AIDE. But after creating a DB I can't access it to check my data/app are working correctly.
I have managed to get run-as to work using adb with my phone plugged into my laptop, but I'd really like it to work straight off the phone so I can code, test and debug, all whilst on the move.
Using connectbot I can see the run-as command in system/bin/ but it has no executable access.
Any ideas?
Related
I am just trying to build a basic app that can write to any file on the phone.
The Galaxy I am using is rooted.
I gave full super user rights with Super-utilisateur app. I am trying using Runtime.getRuntime().exec(su -c touch /data/user/0/com.XXXX/test
But it's not working.
When I do the exact same command in adb shell with the superuser right it does work.
How can I make my very simple app write to any directories on my android phone?
Just to be clear I do not intend to upload that app in the play store, it's just for testing purposes.
The end goal is to write a execute as su a small sh script written in /sdcard/ that moves files around for testing.
Thank you
I was expecting my bash script to run as root with su -c sh /sdcard/test.sh
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/
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.
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 wrote some test cases for a standard browser app using instrumentationtestcase packages for an android phone.
i am able to run the tests when the phone is connected to pc ..
is there a way to include these test cases in the app in such a way that these test cases are run when an activity is invoked!!
thanks in advance
You could use something like Adb Wireless (requires root) which lets you run and test your applications (from the IDE) but without having a cable.
If what you want is running tests by invoking something from the device... then I don't know if it's possible. But at least it seems very useless... what's the point of running JUnit tests if you cannot see what failed?
I would say yes if I have understood your question correctly.
There is "Dev Tools" available in Android emulator. You just need to create emulator in Eclipse. Then you need to fetch/install this application from emulator to your connected device. After that you install your test project in your device. Then you will be able to run that test project independent of your PC by selecting it from Instrumentation menu option of Dev Tools.
Following are the commands (you can change paths accordingly):
To copy from a running emulator to connected device, execute:
adb -e pull /system/app/Development.apk ./Development.apk
To copies the .apk file into the current directory. Then install it on your connected device with:
adb -d install Development.apk
Hope this was your problem and required solution.