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).
Related
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.
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).
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.
I have a requirement to integrate an android application with the ADB Daemon in order to pass commands to it (my Android application) through the USB interface.
Is this possible ?
My intention, is to plug this Android device to a Linux device and allow the Linux device to pass commands to the Android application via USB.
Therefore, since ADB is already implemented, and the ADB drivers for Linux also exist, I was wondering whether it would be easier to leverage this to allow the kind of communication I require.
You can use Activity Manager through adb shell.
For example, "adb shell am broadcast " will send broadcast intent to attached device.
Then your app can handle it with broadcast receiver.
Is it possible to communicate with the Android Debug Bridge (ADB) from inside an app if the service has been loaded through USB?
Here is the use case: I can take a screenshot of the framebuffer through ADB on an unrooted phone with no problem, but it is a little slow to transmit the entire raw buffer over USB, especially if I want to take more than a frame every 2 seconds. What I would like to do is access the framebuffer from inside an app on the phone which can then either transmit it over Wifi or do some compression first. ASL doesn't work on Jellybean (they shut down the loophole to install native services on /data/local), so I would just like to connect to the ADB service via some socket or whatever and issue the framebuffer request that way.
I am ok with having to connect via USB to load the ADB service, but once connected, I would like to do processing on the phone itself before transmission. And it must work on unrooted phones.
Is this possible?
Oneliner:
$ adb shell screencap -p \| gzip -c \> /mnt/sdcard/s.png.gz; adb pull /mnt/sdcard/s.png.gz;