Android shell commands not working (adb Ubuntu) - android

adb sentevent
adb input event
Above event are not working. But 'adb getevent' works properly. while using input tap the android os restarts, and no response while using adb sentevent

Please turn off the developers option, then the input tap event works without restart.

Related

ADB debugging not restarting on reboot

I am running lineageOS on a rooted firestick. I am using ADB on the Firestick to control it via Homeassistant. The problem is that the adb debugging does not automatically work on reboot. Everytime i reboot i have to manually go to the menu turn off the ADB debugging and then turn in back on. After doing this i am able to reconnect adb via network (i.e, on homeassistant).
I want to ask is there any way i can use a script to automatically do this on restart of firestick. I have tried creating a script in init.d with the following contents but it doesn't seem to work.
adb tcpip 5555
I have added the following line to build.prop but this doesn't seem to work too
service.adb.tcp.port=5555
On restart the adb debugging is on in the developer tools but somehow it doesn't connect (either to Homeassistant or to my laptop), what seems to make it work is toggling it off and then back on.

interact between Android Application and ADB

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

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.

Analog Keyboard on Moto360 to replace voice commands?

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.

Can I completely mute the phone using ADB?

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.

Categories

Resources