use adb to get the device name of android device - android

I want to use the adb shell to find out the camera device name of my android device. Usually the name can be dev/video1, however, tablets of NEXUS and Smsung don't work that way.
Could anyone give me hint? About the procedure? How to use the adb shell?
THX!

You can get shell access to your Android device via the following command.
adb shell
The application data is stored in the directory "/data/data/package_of_your_app".
// Assume the gesture file exists on your Android device
adb pull /sdcard/gestures ~/test
// Now copy it back
adb push ~/test/gesture /sdcard/gestures2
It will work for you.

Related

Disable a device owner app from android terminal

well, my problem is: I have an application which is set as the device owner of a device (my tablet in this case). I did it from the terminal in Ubuntu, connecting the tablet to my PC and executting this line in the adb shell:
dpm set-device-owner my.app.package/my.app.route.MyAdmin
So, I want to disable the device owner app without restoring the device, just executing a line similar to the last one. Me and my coworker have been researching for a long time and we've never found anything about this, so I would like to know if it is possible or not, and if it is, how to do that.
Thanks!
you can use the following ADB shell command to remove device owner
adb shell dpm remove-active-admin com.example.app/.AdminReceiver
Disables an active admin, the admin must have declared android:testOnly in the application in its manifest. This will also remove device owner and profile owners
You can use DevicePolicyManager.clearDeviceOwnerApp() from your device owner app.
However note that this method has been deprecated in Android Oreo, you can still use it on Oreo devices but it might be removed in future Android versions.

How to toggle turn on/off mobile data with adb command

I looking for toggle my android phone mobile data with adb command. that is usually i do it with touch my mobile data icon in settings.
i found many reference to do it, for example this question , but nothing work for me, i try use:
$ adb shell svc data enable
$ adb shell svc data disable
when i look to my android phone nothing happen.
my android is KitKat 4 and i sure have rooted
Thanks.

Android : simulate / mimic a call programmatically on device

Is it possible to simulate or mimic a call coming in on an Android device programmatically from the device (not connected to a computer)? I am doing a safety demo about the dangers of calls while driving and I would prefer not to have to create my own copy of the call app.
Yes you can!
Use adb for that, for emulators you can also use the android-studio tools.
adb -s <serial> shell am start -a android.intent.action.CALL -d tel:0612345678
Where <serial> should be your device or emulator id (like emulator-5555)
If you want to do it on the device itself, you can try to call yourself (yes it kind of works on most devices).

Remove Google Glass apk without having root access?

I was testing out the Glass quickstart and chose COMPASS to "re-upload" as a test (tutorial: https://developers.google.com/glass/develop/gdk/quick-start#for_android_beginners)
Now that it worked, I'm stuck with 2x "Compass - sample" and can't call either one by voice commands.
Compass isn't important to me but I am in the process of making an apps for the medical field and I would like to be able to remove it.
Is it possible to remove an .apk from Glass without rooting the device? I have Glass in debug mode and I'm capable of uploading apk's.
Thanks for the help!
You can remove it via the standard way over ADB:
adb shell pm uninstall com.example.MyApp
(where com.example.MyApp is the package name defined in the manifest).
If you have more than one device connected the command will fail - you can direct it to the only attached emulator via the -e flag, the only attached USB device via the -d flag, or a specific device via its serial number and the -s flag (serial numbers as listed in adb devices).

Creating an AVD profile via ADB

Is there any way to get or see all the device's
properties in Android Debug Bridege Shell?
adb-shell shows and retrieves only the device's, which is connected, current prosesses of the current session as I see.
I just wonder that there is an adb-shell script command to see that device's all technical product informations.
I am planning to create an Android Virtual Device profile, but I don't have any technical information about the device. But if I can get those informations from adb, then I will be able to create that profile to build and to run android applications.
To see all connected devices, you can type adb devices
To get the serial number, you can type adb serialno
Also, adb status-window opens a window with constant monitoring of the device
More crazy:
adb shell pm list features shows a list of features the device has
adb shell pm list users shows a list of users the device has (needs root)
You can't really get things like screen resolution etc through ADB unfortunately.

Categories

Resources