Adb Change Device Serial Number
Connect to Fire Tablet through ADB
As an return from 'adb devices' then you can specify the device to target with your next command with: adb -s emulator-5554 shell echo 'hello'. So in this example your command will be executed on the emulator. The Android ID is not device specific and is stored in the user data section. It is a random number, usually generated the device boots the first.
You can use Android Debug Bridge (ADB) to connect your Fire tablet to your computer for testing and debugging. You connect your computer to your Fire tablet through a micro-USB cable.
Android Debug Bridge (ADB) is a command-line utility for running and managing Android apps on your device or emulator. For more information and instructions on using ADB, see Android Debug Bridge.
If you’re looking for instructions on connecting to a Fire TV instead, see Connect to Fire TV Through ADB.
Step 1: Enable ADB on Your Fire Tablet
- On your Fire tablet, go to Settings.
- Tap Device Options, then Developer Options.
- 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 the tablet to your computer.
Older Fire tablets: If you have an older Fire tablet with a different Fire OS version, the steps to enable ADB might differ:
- If you have a Kindle Fire – 1st Generation, ADB is enabled by default.
- If Developer Options is hidden on your tablet, tap the device serial number seven times to reveal the Developer Options menu.
- On a 2013 model Kindle Fire tablet, after tapping Settings, tap Device, then Developer Options, or on a 2013 model Kindle Fire tablet, tap Security.
Step 2: Install the Kindle Fire Driver (Windows Only)
- If you’re using Windows, download this Kindle Fire driver: kindle_fire_usb_driver.zip.
- After downloading the file, extract the contents into a new folder and double-click the Fire_Devices ABD drivers file.
- Proceed through the installation wizard screens to install the driver.
Step 3: Install Android Studio
ADB is available on your computer when you install Android Studio. If you don’t already have Android Studio, download and install Android Studio. If you’re not using Android Studio, you need to download and install Android SDK platform tools.
Step 4: Connect Your Fire Device to Your Computer via Micro-USB Cable
- Using a micro-USB cable, connect your Fire tablet to a USB port on your computer. (For Macbooks that have only USB-C ports, you will need to use an adapter — there isn’t a wifi connection option.)Note that Fire tablets can treat the USB with different transfer options. After connecting the micro-USB cable, swipe down from the top of your tablet to see the USB option used. You might see various notifications, including the USB connection type that was used when you connected the cable. The relevant notification is highlighted in the screenshot below.
If you don’t see “Connected as Media Device”, press Tap for other USB options. Then select Media device (MTP):
Note: If your USB is connected as a Camera (PTP), Android Studio won’t recognize the tablet as a device in Android Studio.
- When is the Allow USB debugging? a dialog appears on your tablet, tap OK.
Open Android Studio and look for the device to appear in devices drop-down menu:
The device’s name will use the
Note that if you have not selected the “Allow USB Debugging” dialog on your tablet, the name “Unknown device” will appear in the devices drop-down menu in Android Studio until you allow debugging.
- With the tablet connected, you can now run your app on your tablet by clicking the Run App button in Android Studio.
If you run into issues, see the Troubleshooting section below.
Check for Device Connections Using ADB (Optional)
Instead of looking in the devices menu in Android Studio, you can also use some ADB terminal commands to confirm that your device is connected. ADB is useful for performing many other operations as well, such as entering sandbox mode or installing other assets. Follow these two sections:
- Add ADB to Your PATH
- Check for Attached Devices
If you skip adding ADB to your PATH, you can also Check for Connected Devices If ADB Isn’t In Your PATH.
Add ADB to Your PATH
First, add ADB to your PATH so you can more easily execute ADB commands. (Your PATH is an environment variable used to specify the location of the program’s executable. If you don’t add ADB to your PATH, running ADB commands will require you to browse to the
- Get the path to your Android SDK platform-tools directory:
- Open Android Studio and click the SDK Manager button. The location to your Android SDK appears near the top next to Android SDK Location. For example:
/Users/<your username>/Library/Android/sdkIf this is your first time opening Android Studio, there isn’t an SDK Manager button. Instead, at the Welcome to Android Studio prompt, click Configure > SDK Manager and provide the location to the Android SDK. - Copy the path to the SDK and paste it somewhere convenient, such as a text editor.
- Add /platform-tools to the end of the path you copied in the previous step. (“platform-tools” is the directory containing the
adb executable.) - Copy the full path to your clipboard.
- Open Android Studio and click the SDK Manager button. The location to your Android SDK appears near the top next to Android SDK Location. For example:
- Use the following command to add ADB to your .bash_profile. Replace with your actual username. Also, make sure the path points to your Android SDK.
Your
.bash_profile the file is usually in your user directory, which you can find by typing cd ~ (change to your user directory). Then type ls -a (list all) to show all files, including hidden ones. If the file isn’t there, simply create one. You can then type
open .bash_profile to see the paths listed. After you add this PATH to your bash profile, you should see the following in your
.bash_profile file: (Only instead of
johndoe, you will see your own username.) - Fully restart any terminal sessions, and then type ADB. If you successfully added ADB to your path, you will see ADB help info rather than “command not found.”
Check for Connected Devices
- Assuming ADB is added to your PATH, run the following commands:
- Confirm that the serial number for your Fire tablet appears in the list of devices. For example:
On your tablet, your device’s serial number is located under Settings > Device Options.
Check for Connected Devices If ADB Isn’t In Your PATH
If your terminal doesn’t recognize
- In Android Studio go to Tools > SDK Manager.
- In the SDK Manager dialog box, copy the Android SDK Location.
- Browse to this location in your terminal or command prompt. For example:
Mac
Windows
Then go into the
platform-tools directory: The
platform-tools directory contains adb. - Now run the
adb commands as follows: Mac:
Windows:
The response should list your device’s serial number. For example:
If your Fire tablet is still not detected, you may need to reboot your computer or log out and back in for the changes to take effect.
Troubleshooting
Tablet doesn’t appear in the list of devices in Android Studio
- If you don’t see your tablet device in the list of devices in Android Studio, click the devices drop-down menu and select Troubleshoot device connections:
- Click Rescan devices.
- If rescanning devices doesn’t detect your Fire tablet as a device, your micro-USB cable might be bad, you might have the wrong USB connection type (e.g, the camera instead of media device), or you might not have enabled USB debugging. You can also try restarting your computer and the tablet.
Uninstall the non-ADB Driver (Windows)
- If you previously connected a Fire tablet without first enabling ADB on the Fire tablet, you might need to remove the existing USB device driver and force the reinstallation of the driver. To remove the non-ADB driver.
- Using a micro-USB cable, connect your Fire tablet to a USB port on your computer.
- On your computer (Windows 10), click the search button (next to the Start menu) and type Device Manager in the search. Then select it in the results. (Other Windows versions have different options for accessing the Control Panel.)
- In the Device Manager window, expand Portable Devices.
- Right-click the Fire device and then click Properties.
- In the Properties window, on the Driver tab, click Uninstall, and then Confirm.
- Unplug your Fire tablet from your computer.
Confirm the Fire Driver Is Installed Correctly
You can confirm that the Fire driver is installed correctly by doing the following:
- On your computer, click the search button (next to the Start menu) and type Device Manager.
- In Device Manager, under Fire Devices, verify that a device appears called Android Composite ADB Interface.If your Device Manager shows the Other Devices section with a second Fire device with a yellow alert sign, your computer is listing Amazon’s unrecognized ADB module as a separate device. To fix this issue:
- Under Other Devices, right-click the Fire device and select Properties.
- On the Driver tab of the Properties window, select Update Driver…
- Choose to browse for the driver software, then navigate to Let me pick from a list of device drivers on my computer > Show All Devices > Have Disk.
- Navigate to the folder where you installed the Amazon driver (typically
C:Program Files (x86)Amazon.comFire_DevicesDrivers) and select it. - Ignore the warning regarding installing drivers and proceed.You should now correctly see your Fire tablet with the ADB driver installed.
Share this:
Android Debug Bridge (adb) is a command line tool which lets you run commands on the connected Android device or an emulator. It is widely used for development purposes and is already available in Android Studio in android sdk/platform-tools. The commands which are run on the device through ADB are called “adb commands”. Here we are going to have a look at complete list of adb and fastboot commands and what actions they perform.
Table of Contents
- 2 List of ADB Commands and their Functions
- 4 List of Fastboot Commands and their Operations
How Android Debug Bridge (adb) works?
According to Wikipedia, the adbd
daemon runs on the device and the adb
client starts a background server to multiplex commands sent to the connected device.
Below are the list of adb and fastboot commands along with the description on what operations it performs.
List of ADB Commands and their Functions
adb devices
This command prints a list of all attached devices with USB Debugging enabled. In response, it returns the serial number and state of the device.
Syntax:
Response:
a123a456 device
adb forward
This command forwards the socket connections. It required USB Debugging enabled on the device.
Syntax:
Example:
Set up forwarding of host port 6100
to emulator/device port 7100
adb kill-server
It terminates the adb server process. Sometimes you might want to terminate the adb server and restart it to resolve the problems.
Syntax:
adb connect
This command allows using adb
over Wi-Fi. This requires the host and the device connected to the same Wi-Fi network.
Syntax:
To use ADB over Wi-Fi, firstly connect the device to PC and set tcp ip port to 5555 using “adb tcpip 5555
” command. Now find the IP address of the device from Settings -> About -> Status -> IP address. Now you can use adb connect command to use ADB over Wi-Fi.
Example:
adb usb
Restarts ADB in USB mode.
Syntax:
adb install
Pushes an Android application (.apk) from host to an emulator or the device.
Syntax:
Example:
adb uninstall
Uninstalls or removes the package from the emulator or Android device.
Syntax:
Example:
adb shell pm list packages
Prints all packages installed on the device/emulator.
Syntax:
Example:
adb shell pm path
Prints the path to the APK of the given package.
Syntax:
Example:
adb shell pm clear
This command deletes all the data associated with the package (clears app data and cache).
Syntax:
Example:
adb pull
Downloads or pulls a specified file from an emulator/device to your computer (host).
Syntax:
Example:
To download test.mp4 to drive D below command is used.
adb push
This command is used to upload or push or copy a file from the host (computer) to an emulator or the device.
Syntax:
Example:
adb shell ls
Lists directory contents.
Syntax:
Example:
adb shell cd
Change the directory or folder.
Syntax:
Example:
adb shell rm
Removes files or directories.
Syntax:
Example:
adb shell mkdir
Make a directory or create a folder.
Syntax:
Example:
adb shell touch
Create an empty file or change file timestamps.
Syntax:
Example:
adb shell pwd
Prints current working directory location.
Syntax:
Example:
adb shell cp
Copy files and directories.
Syntax:
Example:
adb shell mv
Move or rename files.
Syntax:
Example:
adb shell netstat
Shows network statistics.
Syntax:
Example:
adb shell ping
Test the connection and the latency between two network connections.
Syntax:
Example:
adb shell net cfg
Manage and configure network connections via profiles.
Syntax:
Example:
adb shell ip
Show, manipulate routing, devices, policy routing, and tunnels.
Syntax:
object
:= { link addr addrlabel route rule neigh ntable tunnel tuntap maddr mroute mrule monitor xfrm netns l2tp }
optoins
:= { -V[ersion] -s[tatistics] -d[etails] -r[esolve] -f[amily] { inet inet6 ipx dnet link } -l[oops] { maximum-addr-flush-attempts } -o[neline] -t[imestamp] -b[atch] [filename] -rc[vbuf] [size]}
Example:
adb logcat
Prints log data on the screen.
Syntax:
adb shell dumpsys
Dumps system data.
Syntax:
Example:
adb shell dumpstate
Dumps state.
Syntax:
adb shell screencap
Takes a screenshot of the device’s display.
Syntax:
Example:
adb shell screenrecord
Records the device’s screen. It requires the device to be running on Android 4.4 (API level 19) or higher.
Syntax:
Example:
adb root
Restarts the adbd daemon with root permissions.
Syntax:
adb sideload
Sideloads OTA update.zip package and other files on the device. Know more.
Syntax:
Example:
adb shell ps
Prints process status.
Syntax:
Example:
adb shell top
Displays top CPU processes.
Syntax:
Example:
adb shell getprop
Get property via the android property service.
Syntax:
Example:
adb shell setprop
This command is used to set property service.
Syntax:
Example:
What is Fastboot?
Fastboot is a diagnostic protocol primarily used to modify the flash filesystem via USB connection from the host computer. It requires the device be booted into boot loader mode or fastboot mode or secondary program loader mode. Once the fastboot protocol is enabled it accepts the commands sent to it via USB using command line interface.
List of Fastboot Commands and their Operations
Below is the list of fastboot commands which can be used to perform certain operations when the device is connected to the computer (host) in Fastboot mode / Bootloader mode.
fastboot devices
This command is similar to adb devices it prints a list of all attached devices in fastboot mode. In response, it returns the serial number of the device.
Syntax:
fastboot reboot
Reboots the device to normal or standard mode. Used to exit the fastboot mode or boot loader mode.
Syntax:
fastboot reboot recovery
This commands boots the device into Recovery Mode.
Syntax:
fastboot oem unlock
Unlocks bootloader on the device.
Syntax:
fastboot oem lock
Used to relock the bootloader on the device.
Syntax:
fastboot oem device-info
Prints bootloader lock/unlock status.
Syntax:
fastboot flash recovery
Flashes recovery image to the device.
Syntax:
Example:
fastboot boot
Used to boot the image file without installing or flashing on the device. Can be used to boot recovery image without flashing on the device.
Syntax:
Example:
fastboot flash
Flashes flashable zip file from fastboot or bootloader mode.
Syntax:
Example:
fastboot getvar cid
Displays CID (Carrier ID) of the device.
Syntax:
This was the complete list of ADB and Fastboot commands. However, to use the above fastboot and adb commands make sure you have installed ADB and Fastboot drivers – Windows, and Mac.
If you find this post helpful then don’t forget to share it with your friends on Facebook, Twitter, and Google Plus etc.
OneNote 2013 OneNote 2010 OneNote for MacTo open your OneNote 2013 or 2010 notebooks using your Windows Phone, Mac, iPhone, iPad, Android, or Windows device, you’ll need to first move the notebooks to OneDrive or SharePoint.OneNote notebooks saved in OneDrive are limited to 2GB. Import pst to mac mail.