I tried below commands for making outgoing call using ADB command and it's working
adb -s XYZWER56RITYDFS shell am start -a android.intent.action.CALL -d tel:555-5555
But not able to put call on HOLD I tried below command but its not working
adb -s XYZWER56RITYDFS shell am start -a android.intent.action.ON_HOLD
How can I achieve this using any adb keyevent or adb command to put ongoing call on hold.
Related
I have tried to use the following to initiate a phone call:
adb shell am start -a android.intent.action.CALL -d tel:12345
It can work on a virtual device. But on a real phone, there are no responses.
By the way, the following can work on the real one:
adb shell am start -a android.intent.action.DIAL -d tel:1234
Can anybody help me?
I'm trying to play a video on android via adb shell on vlc several times in a row.
When playing the video once the following command was sufficient:
adb shell am start -a android.intent.action.VIEW -d file:////storage/emulated/0/Download/bbb_sunflower_native_60fps_normal.mp4
But now I want to play the video several times/infinitely. Based on: How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command , Start Android activity from command line with extra and https://wiki.videolan.org/VLC_command-line_help/ I tried:
adb shell am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e input-repeat 3 -a android.intent.action.VIEW -d file:////storage/emulated/0/Download/bbb_sunflower_native_60fps_normal.mp4
with various combinations including passing --input-repeat 3 and "input-repeat" 3 without success. E.g: the video would play but only once.
Also didn't help:
adb shell am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e PlaybackMode 1 -d file:////storage/emulated/0/Download/bbb_sunflower_native_60fps_normal.mp4
Does anyone know how it can be done?
I'm trying to write a script which will launch the "app info" system dialog via adb for an app I'm testing.
I have done some investigation and came up with this command, which will launch "app info" but fails with a force close (NullPointerException in logcat):
adb shell am start -a android.intent.action.VIEW -n com.android.settings/.applications.InstalledAppDetails -es com.android.settings.ApplicationPkgName com.my.app -es pkg com.my.app
Seems that the package name isn't being properly passed.
What is the correct way to pass the package name parameter to the am command in this case?
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:<package-name>
Also, check this: https://stackoverflow.com/a/4567928/4409113
adb shell am start -n com.package.name/com.package.name.ActivityName
http://developer.android.com/tools/help/shell.html#am
You can also issue an activity manager command directly from adb
without entering a remote shell.
For example:
adb shell am start -a android.intent.action.VIEW
Seems like, start -a is a good way.
One problem with ADB is that you need multiple commands to get things done.
For example:
adb shell
su
cp /data/local/x /data/local/y
exit
adb pull /data/local/y
Can this be done using python popen and os-system? Tried the example below without success..
print 'Starting emulator...'
subprocess.Popen(['emulator', '-avd', 'testavd'])
os.system('adb wait-for-device')
os.system('Perform whatever adb commands you need')
Any pointers?
You can simply do:
adb shell su -c cp /data/local/x /data/local/y
adb pull /data/local/y
or, if you want to run more than one command (only Linux & OSX):
adb shell <<EOF
ls
date
cat /proc/version
exit
EOF
How can I run android camera program from adb shell?
I know that I should use am but I do not know what command should I exactly enter
I used this:
am start -a android.intent.action.MAIN -n com.android.camera
But it didn't work!
Alternatively, you can start the camera in 2 other ways
Image capture mode: adb shell "am start -a android.media.action.IMAGE_CAPTURE"
Video capture mode: adb shell "am start -a android.media.action.VIDEO_CAPTURE"
Other information
To focus: adb shell "input keyevent KEYCODE_FOCUS"
To take a photo or start/stop recording: adb shell "input keyevent KEYCODE_CAMERA"
Other notes
f the keycode string e.g KEYCODE_CAMERA, does not work, lookup the constant value from the API description. Example: KEYCODE_CAMERA
KEYCODE_CAMERA: Added in API level 1
Constant Value: 27 (0x0000001b)
I'd like to add to Keo Malope's answer that while IMAGE_CAPTURE and VIDEO_CAPTURE are likely to work on most devices, I have encountered cases where they don't work as expected. In this case, we have two more constants that we can try:
STILL_IMAGE_CAMERA
adb shell am start -a android.media.action.STILL_IMAGE_CAMERA
VIDEO_CAMERA
adb shell am start -a android.media.action.VIDEO_CAMERA
Create a CameraActivity class.
Implement camera functionality there and add to AndroidManifest.xml file.
Then use following command:
am start -a android.intent.action.MAIN -n [package-name].CameraActivity
I hope this will solve your problem.
You need to specify exact component name (name of activity).
am start -a android.intent.action.MAIN -n com.android.camera/.CameraEntry
It is working on my device (HTC Desire HD), but I can't guarantee that it'll work everywhere.
it works for me here
adb shell am start -n com.mediatek.camera/com.android.camera.CameraActivity