Setting up Android Debug Bridge to Make Bots

In my next two posts I will teach you almost everything you need to know to make a Bot on your android phone. You can use it to do lots of things in apps and social medias and even include some logic to make a more powerful bot.

One of the bots I have built with ADB did the following:

  1. removed friends from a snapchat account.
  2. took a screenshot of every friend as they were removed.
  3. saved the screenshot in a directory that I specified at the beginning.
  4. added 100 “smurf” snapchat accounts that were used for receiving snaps.
  5. removed each smurf once the score boost was done
  6. added the users friends back using the screenshots I took previously.

In Part Two we will create a script that uses adb to add a list of friends on Snapchat.

There are probably a dozen ways to do this, I have experimented alot and found ADB for most applications to be the best. A close second would be an android emulator like Bluestacks on your computer but some apps (Snapchat is one) are smart enough to know you’re running from an emulator and wont let you login at all.

Requirements:

1. An Android Phone.

2.A computer and the cable to connect to your phone.

2. For  sending commands that tap somewhere on your screen in android you need a rooted phone. You will need this to run most bots.

3. Android Debug Bridge. (ADB) here is a 15 second installer for Windows that I use. here is the official setup but it requires much more work to install.

4. Turn on Developer options. For accurate tap coords there is an option on your phone in dev options to show pointer location. Show layout boundaries also can be useful.

So ADB is going to let us simulate taps and touches via command line input, we can also as we get more advanced use this to save screenshots, move things around in the file system and much more. Pretty much anything that you can do with your fingers you can do through ADB if you know how.

Once ADB is setup you will be able to send commands to your phone while it is plugged in, although later you wont need to always have it connected it is much better while creating and testing a bot to have a keyboard.

To start enter the following in your windows cmd (hit windows key and type cmd to run this program):

$ adb device ( if it tells you about your phone  you set it up correctly)

ADB is not recognized?

Fix:

‘adb’ is not recognized as an internal or external command, operable program or batch file.

it seems like newer versions of windows don’t want adb to be able to make a system wide link so you will need to navigate into your adb folder to use the executable.

  1. Open CMD or Git Bash in your start menu.
  2. Enter cd .. until the directory to the left of your cursor just says ‘c:’.
  3. Enter cd <dir of adb> if you followed my instructions before it will probably be at c/adb so type cd adb.
  4. To run adb you must type ./adb  before every command instead of just “adb” like in the directions above ./ means <current dir>/.

[collapse]

$ adb shell ( this takes you into your phones command line you don’t need to type adb shell before executing every command . The shell is where you type commands to execute on your phone).

$ su ( stands for superuser, required to do some commands like “touch”)

To get familiar with how things work you should experiment with the following commands, in the next post we will be combining them in a shell script to make a Snapchat Bot.

Commands I have used the most:

input tap <x coords> <y coords> (taps there on the screen)

input text <text you want to input>

mkdir <makes a folder>

screencap <directory to save the SS to>

pull <pull too> <pull from> (take files or folders from your phone to your pc)

screenrecord <dir/videoname.mp4>

Leave a Reply

Your email address will not be published. Required fields are marked *