AT Commands in Android - android

I am wondering if someone know what AT Commands are ? i tried to look further on Google but nothing is usefull.
Thank you.

As in the Hayes modem control commands? These are the commands used to gain the *AT*tention of a modem and cause it to interact with the phone system and/or computer (to test, read, set and execute commands). A tutorial can be found here: http://www.engineersgarage.com/tutorials/at-commands

AT commands are commands sent to control dial-up modems.

AT commands are the commands given to modem from the application side to get it's ATtention and execute commands. Please note that the AT commands may differ from device to device depending upon the manufacturer.
And as you have asked specifically for android, so follow the link too know how to send AT commands to Android.
Don't get confused when you see search results for AT commands but got the results for Hayes Commands, the AT commands are part of the Hayes commands.
Also you can find many good resources in the internet for AT commands in general. But again search carefully as the AT commands may differ from device to device.

Related

Is there a way to fake the ADB device, or modify adb.exe/build tools?

I am doing some investigation of a closed-source app using ADB. I would like to log the commands this app is making, the ADB binaries it uses are in the same directory. Would I be able to sniff the commands by faking an ADB device or maybe modding the source code of the build tools to include a log?
Best regards.
I tried using some apps on a physical android device to log the incoming packets, though I got nowhere. I expect to be able to know what this closed source app is doing on my device.
PS: I am sorry if this sounds dumb, I know ADB is open source, part of the Android Open Source Project, but I made this post to make sure I am not missing some small detail. I am not an expert in the ADB protocol so excuse my clumsiness.
Answer:
Copied from this answer to How to fetch ADB shell traffic?
It is as simple as listening on the ADB server's port through Wireshark (TCP port 5037) since all the commands pass through the adb server/daemon before going to USB.
It is also possible to sniff the USB traffic using USBPcap, as it also is unencrypted.

Is it possible to control Android bluetooth device pairing via adb?

I'm looking into automating certain Bluetooth activities via adb.
I have been able to successfully enable and disable Bluetooth using information found here:
android enable disable bluetooth via command line
but need more capabilities and control than just enable/disable.
While looking for solutions I came across this post:
Need ADB command line to start a youtube video using browser
where chrome is controlled via intents/activities.
I've attempted a similar solution with Bluetooth by unpacking (using apktool) the Settings apk and the bluetooth apk, looking at their AndroidManifest.xml files for a list of their intents and activities - then using those intents and activities via adb,
e.g. (running shell as superuser)
am start -n "com.android.settings.bluetooth.RequestPermissionActivity/android.bluetooth.adapter.action.REQUEST_DISCOVERABLE"
Thus far, commands of this nature have either:
1) Failed outright, "unable to resolve intent" or similar issues
2) Led to a ">" prompt wherein I'm expected to give more input (though I'm not sure what I would enter there)
Ultimately, I'm seeking to control BT connections using adb (so as to be able to automate those tasks via scripts in the future).
I am using a Google Pixel 2 (rooted).
If I am on the right track, any guidance or advice would be appreciated.
If I'm going about this completely wrong, feel free to let me know (and hopefully let me know where I should be looking instead).

Connect remotely to an Android device via adb

I'm just testing the adb and I'm wondering if this is possible.
I mean, let's say I have adb installed on a aws instance, whatever the Ip it may be.
Then from there, I want to connect to my Android device via adb I don't know if adb connect can do the trick having the external Ip of the device.
From what I've learned, seems like it is possible, but it's kind of confusing.
Also, I see it's possible to connect without having the device rooted.
But most tutorials or examples are based on wifi, I just want to know if there is a workaround or even a command which can make this possible remotely.
Any ideas?
Thanks in advance!
I would try looking into Vysor. The main purpose of this tool is to be able to control an Android device remotely, but it also provides an option to share the adb connection to the device without a root. Its a powerful tool, that as many applications.

Genymotion scripting

Is it possible to create some kind of scripting with Genymotion?
I know there is shell commands, but I also need to simulate user touch (using adb input).
The idea is to create some simple test for my app, where the script will execute certain shell commands and adb as well.
Thanks
As Genymotion VMs are considered as a physical device by ADB, you can use MonkeyRunner.
This tool, provided by Google allows you to send touches events among other things.
You can script, using Python many inputs. Look at this gist, coming from this StackOverflow post, it gives good example for a complete gesture.

Android debugging via Bluetooth

I was using earlier adb to debug Android applications over wifi, usb - it was great.
Right now I am wondering if it is possible to connect phone with adb via bluetooth.
I did a quick research but didn't find anything - have you tried it already ?
It is not supported by the current adb software, however you could probably make it possible if you have a rooted device (or possibly even if not - see below) either by modifying adb or by using bluetooth to tunnel a channel it does support, such as tcp.
You would need to obtain the source for the adb program - the same source is used to build both the PC and the device versions. First step is to just build it with unmodified functionality, which may take a fair amount of build system modification unless you do so as a part of a complete android source build (the way it was intended to be done)
Then you would modify it to add a bluetooth channel as an option and install it on the device (why you need root) and in your path on the PC. You'd think you could run it from an alternate location on the PC, and you likely can as long as you use it from the command line, but if your fire up DDMS it may kill off the running adb server and launch a new one using the default in the path, so ultimately you'll have to put your modified version there.
IF you can already get your device to accept adb connections over tcp (possible with root, perhaps possible in some cases without) there is another option, which is to not modify ADB (or at least not modify the device side) and instead come up with something running on the device which accepts bluetooth connections and forwards the traffic via local loopback to the tcp port on which the stock adb is operating. This would save the trouble of having to rebuild adb.
If you have some kind of tethering or similar network-over-bluetooth solution, you might even be able to leverage that to carry adb-over-tcp-over-bluetooth without writing any code.
Finally note that it is not 100% essential that the adb daemon run as a more privileged userid or be installed in place of the official one - you can run an adb daemon as an ordinary application and do many of the expected things with it. However, whichever adb daemon is running first will grab the unix domain java debug socket, and so only that adb daemon will be able to provide the full java debug services. More primitive things like logcat, shell, running process list, push/pull, etc will at least partially work without this, provided that your adb daemon doesn't quit (modification may be required) when it is unable to claim the debug socket. If you can kill the official adb daemon and exploit a race condition, you may be able to get an unofficial one started before it restarts - you would probably need to have a script or program to do this and run it with setsid from the official adb shell, meaning you'd need to connect via USB first. At that point, you'd also be able to start your unofficial adb daemon running as the same userid as the official one.
You may want to spend some time estimating or testing if the performance (speed) will be satisfactory before investing in a lot of time setting this up for real.
I know this is a bit old but I seem to have found a post that does this. All credit goes to the author of fomori.org for finding this and making the information available. Today it helped me, maybe tomorrow I'll help you by making it easier to find.
Source

Categories

Resources