My pc does not support android emulator and i need to make fake incoming calls from adb for testing. I've tried this line
adb shell am start -a android.intent.action.CALL -d tel:123456
but it creates outgoing calls and i need incoming. Is there a way to make incoming calls from adb on a physical device without emulator?
My solution was to connect 2 physical devices to the PC and make a call between them.
You can find their IDs by adb devices and then use
adb -s [ID1] shell am start -a android.intent.action.CALL -d tel:123456 where ID1 is the ID of the caller.
Related
I want to trigger a Skype call (possibly to the Echo/ Sound Test Service) via adb.
So far I was able to open skype via the following command
"adb shell am start -n com.skype.raider/com.skype4life.MainActivity"
but I could not progress further. Does anybody have any insights?
Use
adb shell am start -a android.intent.action.VIEW -d skype:echo123?call
I tried and it works.
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).
I have been exploring various options with adb by connecting to real device. Went thru the android documents.
By reading random documents, i found out that i can open a webpage directly by adb using
adb shell am start -a android.intent.action.VIEW -d http://www.wikipedia.org
or i can send BT turn On request using
adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
I am wondering, if i can find all such functions at one place or how to explore more about what all could be done using adb.
Here is a collection of ADB commands , i am collected from various sites & books
Please go through this . Feel free to ask any doubts regarding these commands
If my device has opened itself up to Wireless ADB, how can I determine if another device has connected to my device? Currently there's no warning (at least on my device) alerting me when somebody successfully connects to my phone.
I know I have to go out of my way to allow wireless connections and it's pretty stupid to leave that on when you're not planning to use it, I'm just curious if it's programmatically possible to know these things.
Is there a dump I can run or a path I can cat to see if something's connected? Can my code be notified when something tries to connect? If I can tell if something is connected, how much information can I get on what connected, if any? Is root required for any of this?
I was in the same boat, here how I got what I need:
netstat -lptu | grep -E '5555.*ESTABLISHED' | cut -s -d ':' -f2 | awk '{print $2}'
This shows the IP of the one connected to the android device! You can change the port with no problem
Then you can use the information in a "IF" statement for example to grep the IP on a white or black list!
You can use Scripting Layering For Android and make a Toast Notification whenever someone tries to connect or make a Push Notification with the ability to display a dialog asking for some action like disabling the adb wireless.
Here is a way to Enable/Disable ADB Wireless:
Enable:
setprop service.adb.tcp.port 5555 ; stop adbd ; start adbd
Disable:
setprop service.adb.tcp.port -1 ; stop adbd ; start adbd
How to find what service running on background on Android?
like input method service, ....
Using adb or terminal on android device ?
Could I use "top" or "ps" command?
Maybe I have to ask in another way?
Does the service be presented as one "process", then we can use "ps" or "top" command to find it?
A more precise way to show running services is by using dumpsys.
To get a list of all running services:
adb shell dumpsys activity services
To show the status of a particular service:
adb shell dumpsys activity services <partial-service-name>
For example, if your service name is com.example.MyService:
adb shell dumpsys activity services MyService
If you are running the emulator or have a connected device, you can launch adb with 'adb shell' from the command line and you can run all those linux binaries like top and ps.