I was doing what suggested here: Sending AT Commands Via ADB Android
So after I rooted my Samsung S5, I found my modem with this command: getprop rild.libargs and I got this result: -d /dev/smd0
Then I typed into my adb shell: echo -c "AT\r\n" > /dev/smd0
But nothing is returned.
I don't understand, any idea ?
I also tried other commands like: AT+CREG or AT+COPS=?, still nothing.
Related
I can call using below command to make a call:
"**adb shell am start -a android.intent.action.CALL 0000000000**"
and during the call, tried to mute and unmute microphone using the command:
"adb shell am start -a android.media.action.MICROPHONE_MUTE_CHANGED"
But, I got an error message that
"Error: Activity not started, unable to resolve Intent { act=android.media.action.MICROPHONE_MUTE_CHANGED flg=0x10000000 }"
Can I know how to fix it?
I need help sending text to a particular group using the adb shell.
Searching the forums here, I found the code below:
adb shell am start -n com.whatsapp/.Main
adb shell am start -a android.intent.action.SEND -t text/plain -e jid
'xxxxxxxxxxx#s.whatsapp.net' --eu android.intent.extra.STREAM
file:///storage/emulated/0/DCIM/Camera/IMG_20181025_223214.jpg -p com.whatsapp
the question is:
How to identify a group's JID.
How to change this code to send a text instead of a file.
Groups jid you can get in messages.db at chat_list table by gorup name (subject column) or at messages table by message text. it will be like 77787987018-1602484814#g.us.
To send text u can use this command:
am start -a android.intent.action.SEND -c android.intent.category.DEFAULT -t text/plain -e jid {user jid} -e android.intent.extra.TEXT "{text}" -p {whatsapp packet name}
I have a batch script that makes backups from remote camera drives on a private network using wget:
echo off
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%i in (1 2 3 4 5) DO (
wget64 --http-user admin --http-password instar -r -l inf -nc -e robots=off --directory-prefix=C:/temp/VID_DOWNLOAD -A "*.avi" -R "*999999.avi" http://192.168.0.11%%i/sd/
)
Sometimes (I have not been able to identify why), the wget encounters a problem and must terminate. This generates a dialogue that requires user interaction.
It does not bother me if there is an error, since the script is launched automatically every 5 minutes and wget eventually works fine. The problem is that I manually have to intervene and acknowledge the error.
I don't have much information about the error - it shows up like this:
Would it be possible to get wget to fail silently?
I run a command in Linux remote machine using plink (from batch file in Windows).
For example:
plink.exe -ssh root#IP -pw pass -m testCommands.txt >> uninstall.log
In testCommands.txt I have a command that perform uninstall of application,
the problem is that command of "uninstall" require an answer (y or n),
How can I send answer in addition to what I already send?
Here is the question I have:
[?7hAre you sure you want to completely remove "APPLICATION" and all of its components?
Yes [y, Enter], No [n]"
There are several options...
Use a -y or auto-confirm option on the command that removes the software, e.g.
pkg rm -yes somePackacge
Use a pipe to send the yes, so that the command you run in PLINK looks like
printf "Yes\n" | pkg rm some_package
or
yes | pkg rm some_package
Make the command that you run on the Linux machine be based on expect which can spawn your remove command, wait for a question and then send it a confirmation. Some expect examples here.
I am on the 6.0.1 Marshmallow OS and my previous commands to change the preferred network mode are no longer working.
Commands used in Kit Kat worked without issue:
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "SELECT * FROM global WHERE name='preferred_network_mode'"
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global SET value=1 WHERE name='preferred_network_mode'"
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "select value FROM secure WHERE name='preferred_network_mode'
Commands from above entered in this OS result in output:
Error: no such table: global
I pulled the database file, which was completely empty:
adb pull /data/data/com.android.providers.settings/databases/
Is there any ADB command that I can use to change the preferred_network_mode to LTE/GSM?
After a lot of research, this was the working solution I found for Marshmallow.
The Preferred Network Mode numbers are found:
https://android.googlesource.com/platform/hardware/ril/+/master/include/telephony/ril.h#228
1 is GSM Only
11 is LTE Only
adb wait-for-devices
adb root
adb wait-for-devices
adb shell settings list global | grep pref
This returned to me both "preferred_network_mode" and "preferred_network_mode1"
adb shell settings put global preferred_network_mode 1
adb shell settings put global preferred_network_mode1 1
adb shell stop ril-daemon
adb shell start ril-daemon
For setting RAT on SUB1, run below command:
adb wait-for-devices
adb root
adb wait-for-devices
adb remount
adb shell settings put global preferred_network_mode 1
adb shell settings put global preferred_network_mode1 1
adb shell stop ril-daemon
adb shell start ril-daemon
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
adb shell sleep 5;
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
Now, check if RAT is set or not by running below command:
adb shell dumpsys telephony.registry | grep mServiceState
adb shell:
content update --uri content://settings/global --bind value:i:12 --where "name='preferred_network_mode'"
12 == LTE + WCDMA, for more see ril.h
dont forget to set preferred_network_mode1 and preferred_network_mode2 and preferred_network_mode3