adb is included in the Android SDK Platform-Tools package. You can download this package with the SDK Manager, which installs it at android_sdk/platform-tools/
how to find the android_sdk path. in android studios, go to preferences and type sdk in the search bar
Thanks to Bevin for the following writeup:
Steps for using AndroidWifiADB
Installation
- Open Android Studio
- File -> Settings to open the settings pop-up . (or Android Studio->Preferences)
- Select 'Plugins' from list on left hand side of the pop-up
- Type 'Android Wifi ADB' into the search bar . (then click 'search in repositories')
- Click on 'Android Wifi ADB' then install and restart Android Studio once that's done
To pair an RC
- Connect both your laptop and the phone to the same, non-Direct wireless network
- Cannot use the peer to peer connection the RC and DS use
- If at Mayfield, connect both to 'MSS Staff'
- On the RC, go to 'Settings' and click 'Connect to PC'(green icon, in the 'DEVICE' section) . (settings->about phone->tap on Build number 7 times to become a developer. Now you will find settings->developer options->USB debugging (turn it on), then on same page, look for "Select USB Configuration", which should default to MTP
- Make sure the connection type selections is 'Media device (MTP)'
- Ensure the checkbox for 'Enable USB debugging' is checked
- Ensur the checkbox for 'Don't ask me again' is checked
- Connect your phone to the your computer with a USB
- Make sure your computer chimes and asks you what you wish to do with the device, opens a folder, or acknowledges the phone in some way
- Click the 'AndroidWifiADB' button in Android Studio (looks like the head and shoulders of a person)
- You should get a ballon saying the device is now connected
- now you can unplug your usb cable from your phone.
- when you are ready to download your APK, you can push the green play button on Android Studio's. If it complains that "Application Installation Failed" since the device already has a newer version. Do you wish to install? Just click on the ok/yes button
In Android studio, click on the terminal tab
then do a 'which adb'
This shows you that the adb is installed at /Users/coda/Library/Android/sdk/platform-tools/adb
If you want, you can add it to your path, so you can find it outside of Android Studio:
Go to ftc_app/doc/apk
Plug in the cable from mac to DS phone and do the following: adb install FtcDriverStation-release.apk
Plug in the cable from mac to RC phone and do the following: adb install FtcRobotController-release.apk
you do not have to connect up the wire between laptop and control hub
Connect your laptop to the FTC-xxxx control hub's wifi direct network
adb connect 192.168.43.1:5555
Then push the play button to upload the program
go to your android studio settings, got to tools>external tools> click the plus button, then fill it out with this: Name: HUB connect over Wifi direct, Group: External tools, Description: N/A, Program: $ModuleSdkPath$/platform-tools/adb, Arguments: connect 192.168.43.1:5555, Working Directory: $ProjectFileDir$. Then click done.
Now to connect, you first have to connect to the Control hub's wifi direct, then at the top of your toolbar, go to tools>external tools then click Hub Connect over wifi direct
First plug in RC phone into laptop with USB cable
Change directories into the directory on your laptop where you want to put the robot config files that you pull
adb devices // which lists the attached devices. We want to verify that it can see the phone
adb shell // to go onto phone . (note that on the new MOTO phone the way you find it on your phone is go to Settings->Storage, then click on Explore, the go into the FIRST folder, and then you will find you <configname>.xml file
cd //sdcard/FIRST
ls // to list the files in that directory and see if your robot config file is there
now exit adb shell by typing 'exit'
adb pull //sdcard/FIRST/lameingo.xml <destination_directory> // example dest dir: C:\Users\Breanna\Desktop or can omit the <destination_directory> and it will pull the file into the current directory. Note "//sdcard" has two slashes in front of it.
once you retrieve the lameingo.xml file, you can copy it to ftc_app/FtcRobotController/src/main/res/xml so that the next time you download your opmode, it will include the robot configuration file
adb is installed when you install your android SDK, however, Windows will not be able to find the path to it by default, so you must do the following:
In the search window, look for "Command Prompt"
In the "Command Prompt" window, navigate to C:\Users\coda\AppData\Local\Android\sdk\platform-tools where adb.exe is installed
Now go to the Control Panel->System and Security->system->Advanced System Settings (and you will be to allow this app to make changes to your device). Once you click on the "yes" button, a "System Properties" window will pop up and then you click on the "Environment Variables..." button
Under the "User variables for <username>" or the "System variables"??, you will edit the "Path" variable and append to it the following: C:\Users\coda\AppData\Local\Android\sdk\platform-tools
Do a "which adb" in a terminal window. If it can't be found, then in Android Studio->ProjectSettings you will find that the Android SDK is installed in /Users/<username>/Library/Android/sdk
printenv PATH // to see the current PATH and add the following to the path
in your ~/.bashrc add the following:
export PATH=$PATH:/Users/<username>/Library/Android/sdk/platform-tools
Plug in Android phone to laptop with USB cable
you may have to source ~/.bashrc (once you've put the path to adb in your .bashrc file. see step above)
adb devices // shows which devices are attached
Make sure your PC is on the same wifi as the phone (e.g., "MSS Student" or "MSS Staff") Do NOT use the DIRECT-xxx wifi connections!!
On the phone, under wifi select wifi name (e.g., "MSS Student" or "MSS Staff") and click on connected wifi and look for IP address (e.g., 10.40.0.37 for MSS Student) Actually under wifi, click on the gear icon for settings
adb devices // shows which devices are attached
NOTE: if you do not see the phone device, then try the following "adb kill-server" then "adb start-server"
adb usb # make sure adb is in usb modr
adb tcpip 5555
adb connect 10.0.1.198 (old ip addr: 10.40.0.37) . (to find this ip address, go on your robot controller phone settings->about->status->ip address
Now you can disconnect the USB cable .
You may want to open the adb window at the bottom of Android Studio in order to see the robot log output
TROUBLESHOOTING: If you are having trouble with the connection, try "adb disconnect" and redo the adb commands above
note that if another computer was previously connected to the same IP (10.0.xxx.xxx) that can be found under settings->wifi->gearSettings, then they must do a 'adb disconnect 10.0.xxx.xxx' or just an 'adb disconnect' which disconnects all devices
Note there was a case where the 'adb connect 10.0.xx.xxx' was successful, when the phone was connected, but once it was disconnected, then it couldn't find the connection, so first we checked 'adb devices' (while the phone was disconnected) and it found the device, then re-did the 'adb connect 10.0.xx.xxx' and it worked.
It also seems to occur frequently when you connect to the device using the Wi-Fi mode (in Android Studio or in the console by running adb tcpip 5555 for example).
To fix:
Disconnect the USB connection—or turn off the device's Wi-Fi if you're connected over Wi-Fi.
Close Android Studio/Eclipse/other IDE.
Run adb kill-server to ensure adb is not running.
Restart your Android device.
After your device restarts, connect it via USB and run adb devices. This should start the ADB daemon. Your device should now be online again.
ADB Troubleshooting
If your device normally connects over USB, but suddenly stops working, especially after the USB cable has been disconnected and reconnected, try the following non-invasive steps before doing some of the more drastic things mentioned in the other answers:
adb kill-server
adb start-server
adb devices
If your device is listed with 'device' next to it, you're back in business.
If your device is listed with 'offline' next to it, try restarting the device. The ADB daemon on the device will occasionally get hung. I've noticed this more when I've disconnected the cable while LogCat is running and after switching back from connecting via Wi-Fi or Ethernet.
How to download opmodes from Android Studio to phone wirelessly
First make sure adb is installed on your machine, Android Studio does not contain ADB, you need Android SDK for it (it is installed on first run of Android Studio 0.9.x and newer). ADB is located in sdk\platform-tools .
Connect the phone via USB and make sure debugging is working
In the Android Studio terminal, you can type the following:
adb devices /* to see if adb sees your phone */
adb tcpip 5555 /* use port 5555 */
Find the IP address with "adb shell netcfg" or "adb shell" or look at "Program & Manage" on your FTC DS or RC app
adb connect <device_ip_address>:5555
disconnect USB and proceed with wireless debugging
adb -s <device_ip_address>:5555 usb /* to switch back when done */
settings->