ADB Setup - RobotGirls/FTC-Team-25 GitHub Wiki
Usually you upload your Android Studio code to the robot through a wired connection. You can use the Android Debug Bridge (ADB) protocol to do this wirelessly!
To get ADB
ADB is included in the Android SDK Platform-Tools package. You can download this package with the SDK Manager, which installs it to android_sdk/platform-tools/
To find the android_sdk path
- In Android Studios, go to Preferences and type "sdk" in the search bar
- It's also under Preferences -> Appearance and Behavior -> System Settings -> Android SDK
To install ADB
- In 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 check that it's installed, click on the "Terminal" tab in Android Studio
- Type
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
- Type
To pair an RC
- Connect both your laptop and the phone to the same wireless network (not DIRECT-XXX)
- If at Mayfield, connect to "MSS Staff"
- Cannot use the peer to peer connection the RC and DS use
- On the phone, go to Settings -> Connect to PC (green icon, in the "DEVICE" section)
- On the phone, make sure the connection type selections is "Media device (MTP)"
- Settings -> About Phone -> tap on Build Number 7 times to become a developer. Now you'll find Settings -> Developer Options -> USB debugging. Turn it on. On same page, look for "Select USB Configuration", which should default to MTP
- On the phone, ensure the checkbox for "Enable USB debugging" is checked
- On the phone, ensure the checkbox for "Don't ask me again" is checked
- Connect the phone to the your computer with a USB
- Check the laptop to see if the connection is good. It could chime or ask you what you wish to do with the device
- 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
- Unplug the USB cable from the phone
- When you are ready to download your APK, push the green play button in Android Studio
- 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
How to wirelessly upload a program
- Connect your laptop to the FTC-xxxx control hub's wifi direct network
- In Android Studio, "Terminal" tab, type
adb connect 192.168.43.1:5555
- Push the play button to upload the program
Troubleshooting
- If you are having trouble with the connection, try "adb disconnect" and redo the adb commands above
- 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
- 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