Setting up your Kindle Fire device for testing and debugging is a simplified process thanks to Android Debug Bridge (ADB) support. Since questions around ADB driver support have come up on Stack Overflow and our developer forums I thought it would be beneficial to walk through the setup process.
Connect device using USB cable to the host computer. Confirm USB debugging is enabled in device. Set target device to connect TCP/IP on port 5555. $ adb tcpip 5555. Now, disconnect the USB cable from the device. In Android device find the IP address from Settings wi-fi Setting Advanced IP Address. Click “Browse” and navigate to the folder where you extracted your adb files. Next “okay” out of all of the Windows you have open. Start a new PowerShell or command prompt and type. The device serial number (as reported by ‘adb devices’) appears to be set in the kernel, under arch/arm/plat-s5p/devs.c (look for ‘deviceserial’). This may be different for your device, I’d suggest a grep through the kernel sources for the device ID that is reported by adb devices. You can change the locale/language for testing purposes without rooting the device, also on newer (4.2+) devices. You have to create an application that changes the device locale. Or, you can use a helper app, e.g. ADB Change Language.
Certain development tools referenced in this post are provided by third parties, not by Amazon. Any links to these tools will take you to third-party sites to download and install them.
Note – this post was updated on April 16th, 2014 to reflect changes in the Amazon Android SDK addon.
First, ensure your development computer has at least one package of Kindle Fire system images installed. This is critical because the package includes the vendor identification needed for ADB to recognize any of the physical Kindle Fire tablets. This is done through the following steps:
- Ensure you have the Android SDK already installed
- Launch the Android SDK Manager
- Under Tools, select Manage Add-On Sites, and enter the following url: http://kindle-sdk.s3.amazonaws.com/addon.xml
- Select Close and wait for the list of available packages to refresh
- Select Kindle Fire USB Driver, Kindle Fire Device Definitions, and optionally the Amazon AVD Launcher.
- Select at least one Kindle Fire image so that vendor information is available for ADB. I’ve chosen to select the three Kindle Fire 3rd Generation images (API Level 17).
- Accept the license agreements and install.
For complete information about setting up your development computer and installing the SDK packages, see Setting Up Your Development Environment.
If you installed a previous version of the Kindle Fire USB driver then take the following steps to remove the previous USB device driver and force re-installation of the driver.
- Connect your Kindle Fire tablet to the USB port on your development computer.
- On the development computer, from the Start menu, right-click Computer, and then click Manage.
- In the left pane, under Computer Management, expand System Tools, and then click Device Manager.
- In the right pane, expand Portable Devices.
- Next, Right-click Kindle and then click Properties.
- In the Kindle Properties window, on the Driver tab, click Uninstall, and then Confirm.
- Finally, unplug your Kindle Fire tablet from your computer.
Next, we need to turn on ADB support on our actual Kindle Fire device. Follow these steps:
- On your Kindle Fire tablet, go to Settings.
- On a third-generation Kindle Fire tablet, tap Device. On a second-generation Kindle Fire tablet, tap Security. First-generation Kindle Fires already have ADB enabled by default so no action is needed.
- Set Enable ADB to On, and then accept the pop-up warning message.
As a security precaution, you should set Enable ADB to Off when you are not trying to connect to the Kindle Fire tablet to your development computer.
First, ensure you have enabled ADB on the Kindle first as described above. For the USB driver to install correctly, Windows must recognize the device as Android Composite ADB Interface during installation. If ADB is not enabled, Windows instead recognizes the device as Portable Devices.
Do the following to install the Kindle Fire USB driver:
- In your Android SDK directory, at extrasamazonkindle_fire_usb_driver, run KindleDrivers.exe, and then follow the instructions on the screen.
- Connect your Kindle Fire tablet to a USB port on your development computer.
- From Start, click Control Panel, and then select Device Manager.
- In Device Manager, under Kindle Fire, verify that the device appears as Android Composite ADB Interface.
Next, do the following to detect your Kindle Fire tablet through ADB:
- Open a command prompt window.
- Change directory to your Android SDK platform-tools directory.
- Run the following commands and confirm that the serial number for your Kindle Fire tablet appears in the list of devices.
adb kill-server adb start-server adb devices |
If the serial number does not appear after running adb devices, do the following:
- Change directory to your Android SDK tools directory.
- Run the following command:
android update adb |
- Change directory back to your Android SDK platform-tools directory.
- Run the following commands:
adb kill-server adb start-server adb devices |
If your Kindle Fire device still does not show up you may need to reboot your development machine and then try again.
Perform the following steps if your development computer runs OS X:
- Connect your Kindle Fire tablet to a USB port on your development computer.
- Open a terminal shell and navigate to your Android SDK tools directory.
- Run the following command to update ADB.
./android update adb |
4. In the terminal shell, navigate to your Android SDK platform-tools directory.
5. Run the following commands and confirm that the serial number for your Kindle Fire tablet appears in the list of devices.
If your Kindle Fire device does not show up in the list of devices you may need to reboot your development machine and then try again.
You should now be able to fully test with your Kindle Fire device over the Android Debug Bridge. For additional information on enabling ADB for Kindle Fire Devices, see Setting Up Your Kindle Fire Tablet for Testing.
-Dave (@TheDaveDev)
-->This article explains how to setup an Android device and connect it to a computer so that the device may be used to run and debug Xamarin.Android applications.
After testing on an Android emulator, you will want to see and test your apps running on an Android device. You will need to enable debugging and connect the device to the computer.
Each of these steps will be covered in more detail in the sectionsbelow.
Enable Debugging on the Device
A device must be enabled for debugging in order to test an Androidapplication. Developer options on Android have been hidden by defaultsince version 4.2, and enabling them can vary based on the Androidversion.
Android 9.0+
For Android 9.0 and higher, debugging is enabled by followingthese steps:
- Go to the Settings screen.
- Select About Phone .
- Tap Build Number 7 times until You are now a developer! is visible.
Android 8.0 and Android 8.1
- Go to the Settings screen.
- Select System.
- Select About Phone
- Tap Build Number 7 times until You are now a developer! is visible.
Android 7.1 and lower
- Go to the Settings screen.
- Select About Phone.
- Tap Build Number 7 times until You are now a developer! is visible.
Verify that USB debugging is enabled
After enabling developer mode on your device, you must ensure that USB debuggingis enabled on the device. This also varies based on the Android version.
Android 9.0+
Navigate to Settings > System > Advanced > Developer Options and enable USB Debugging.
Android 8.0 and Android 8.1
Navigate to Settings > System > Developer Options and enable USB Debugging.
Android 7.1 and lower
Navigate to Settings > Developer Options and enable USB Debugging.
Once the Developer Options tab is available under Settings >System, open it to reveal developer settings:
This is the place to enable developer options such as USB debugging andstay awake mode.
Connect the device to the computer
The final step is to connect the device to the computer. The easiest andmost reliable way is to do so over USB.
You will receive a prompt to trust the computer on your device if you havenot used it for debugging before. You can also check Always allow from thiscomputer to prevent requiring this prompt each time you connect the device.
Alternate connection via Wifi
It is possible to connect an Android device to a computer without using a USB cable, over WiFi. This technique requires more effort but could be useful when the device is too far from the computer to remain constantly plugged-in via cable.
Connecting over WiFi
By default, theAndroid Debug Bridge (ADB)is configured to communicate with an Android device via USB. It ispossible to reconfigure it to use TCP/IP instead of USB. Todo this, both the device and the computer must be on the same WiFinetwork. To setup your environment to debug over WiFi complete the following stepsfrom the command line:
Determine the IP address of your Android device. One way to findout the IP address is to look under Settings > Network & internet > Wi-Fi,then tap on the WiFi network that the device is connected to, and then tap onAdvanced. This will open a dropdown showing information about the networkconnection, similar to what is seen in the screenshot below:
On some versions of Android the IP address won't be listed therebut can be found instead under Settings > About phone > Status.
Connect your Android device to your computer via USB.
Next, restart ADB so that it using TCP on port 5555. From a commandprompt, type the following command:
After this command is issued, your computer will not be able to listen to devices that are connected via USB.
Disconnect the USB cable connecting your device to your computer.
Configure ADB so that it will connect to your Android device on the port that was specified in step 1 above:
Once this command finishes the Android device is connected to the computer via WiFi.
When you're finished debugging via WiFi, it's possible to reset ADB back toUSB mode with the following command:
It's possible to request ADB to list the devices that are connected to thecomputer. Regardless of how the devices are connected, you can issuethe following command at the command prompt to see what is connected:
Adb Change Device Time
Troubleshooting
In some cases you might find that your device cannot connect to the computer. In this case you may want to verify that USB drivers are installed.
Install USB Drivers
This step is not necessary for macOS; just connect the device to theMac with a USB cable.
It may be necessary to install some extra drivers before a Windowscomputer will recognize an Android device connected by USB.
Note
These are the steps to set up a Google Nexus deviceand are provided as a reference. Steps for your specific device mayvary, but will follow a similar pattern. Search the internet for yourdevice if you have trouble.
Run the android.bat application in the [Android SDK install path]toolsdirectory. By default, the Xamarin.Android installer will put theAndroid SDK in following location on a Windows computer:
C:Users[username]AppDataLocalAndroidandroid-sdk
Download the USB Drivers
Google Nexus devices (with the exception of the Galaxy Nexus) requirethe Google USB Driver. The driver for the Galaxy Nexus isdistributed by Samsung.All other Android devices should use theUSB driver from their respective manufacturer.
Install the Google USB Driver package by starting the Android SDKManager, and expanding the Extras folder, as can be seen in thefollow screenshot:
Check the Google USB Driver box, and click the Apply Changes button.The driver files are downloaded to the following location:
[Android SDK install path]extrasgoogleusb_driver
The default path for a Xamarin.Android installation is:
C:Users[username]AppDataLocalAndroidandroid-sdkextrasgoogleusb_driver
Installing the USB Driver
After the USB drivers are downloaded, it is necessary to install them.To install the drivers on Windows 7:
Connect your device to the computer with a USB cable.
Right-click on the Computer from your desktop or Windows Explorer,and select Manage .
Select Devices in the left pane.
Locate and expand Other Devices in the right pane.
Right-click the device name and select Update Driver Software .This will launch the Hardware Update Wizard.
Select Browse my computer for driver software and clickNext .
Click Browse and locate the USB driver folder (the Google USBdriver is located in [Android SDK install path]extrasgoogleusb_driver).
Click Next to install the driver.
Adb Change Devices
Summary
This article discussed how to configure an Android device fordevelopment by enabling debugging on the device. It also covered how toconnect the device to a computer using either USB or WiFi.