How to turn on WIFI through adb on a motorola XYboard using android version 4.0
I have already tried the commands
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
adb shell input keyevent 20 & adb shell input keyevent 23
but it just takes to the wifi settings, but the keyevent 20 is not taking to the "ON/OFF" button. In the new 4.0 version of android, we have to do a click on ON/OFF btton next to the WIFI to turn it on. How do I get to click that button using adb
Is there a command that will turn the wifi ON directly like the one for bluetooth, I can use
adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
for turning bluetooth ON.
Please check the keyevent codes for your phone, the keyevents 20 and 23 are for Droid X,
the other droid X keyEvents are listed in this post : ADB Shell Input Events
So on your device the keycode events might be slightly different...
Related
The recommended command is
adb shell input keyevent 6
But this only works with non-emergency calls. The device doesn't respond to this command during an emergency 911 call.
Any idea how would I go about ending a 911 call using adb commands ?
I modified android phone hdmi output properties using ADB commands below
adb shell setprop persist.demo.rotationlock false
adb shell setprop persist.demo.singledisplay true
In order to see the change,
I will have to do either one of the following.
turn off phone screen, then turn on phone screen.
restart the phone or tv
unplug the phone to monitor, then plug the phone to monitor.
What I want:
Is there any command to do a quick reload/reset/refresh phone screen or video output connection? so I don't have to do any of the above to see the change.
Any help is appreciated
To "turn off phone screen, then turn on phone screen":
adb shell input keyevent 26
Run the above command twice.
26 is the keyevent code for power button.
To "restart phone":
adb reboot
I am running an application from ADB commands as follow:
adb shell am start -n com.example.someapp.app/.SimpleActivity
The main screen in this app will have two buttons, how can press one of these buttons from ADB Shell?
It looks like the adb shell input command might work for you. You might need to have a rooted device to allow adb simulated touch input to work.
Here's a link to a blog containing a write up on adb input:
https://grymoire.wordpress.com/2014/09/17/remote-input-shell-scripts-for-your-android-device/
You'd normally tap the button (if you know the coordinates):
adb shell input tap <x> <y>
To find coordinates, enable pointer location, then tap the button location on your device:
adb shell settings put system pointer_location 1
No need to root phone.
Tested on Android 10 API 29
I'm (trying) to use Analog Keyboard for Android Wear from Microsoft Research.
The wearable (Moto360) is properly setup for Bluetooth debugging and the install procedure for the Keyboard finishes as expected:
$ adb devices
List of devices attached
4df11bb241805f93 device
localhost:4444 device
$ adb -e install com.microsoft.research.analogkeyboard-Signed.apk
50 KB/s (5322694 bytes in 103.401s)
pkg: /data/local/tmp/com.microsoft.research.analogkeyboard-Signed.apk
Success
$ adb -e shell ime enable com.microsoft.research.analogkeyboard/.KeyboardService
Input method com.microsoft.research.analogkeyboard/.KeyboardService: now enabled
$ adb -e shell ime set com.microsoft.research.analogkeyboard/.KeyboardService
Input method com.microsoft.research.analogkeyboard/.KeyboardService selected
After that, the Analog Keyboard app is visible in the list of installed apps on the watch and, when opened, works really fine.
The challenge is to make it replace voice commands. Is that possible?
No, it is not possible to intercept or change the voice input mechanisms used throughout Android Wear.
I would like to turn off all the sounds on my Android device, using ADB.
Is that possible?
In a terminal run:
adb shell input keyevent 164
Run "adb shell input keyevent 25" multiple times in a batch file
One solution could be to make an app that you install on the phone which can receive an intent sent via adb and then have the app do the muting.