Jan 31, 2012 - Despite its former problems, when the ICS update started rolling out to the. Make sure you enter your serial number correctly, in all caps! USB drivers for the Transformer Prime are installed, as well as ADB (Android SDK). Jul 4, 2013 - The reason for this is that the reported serial number isn't always the re. Android-tools (Ubuntu) Edit. Fix Released. Ricardo Salveti. If adb doesn't work properly because of the new flipped images, then some new.
- Firmware Change/Update. XIAOMI Redmi Note 8 Pro. Information about your iOS device (Find the Serial Number and IMEI).
- How do I check device serial number?
Download Acer support drivers by identifying your device first by entering your device serial number, SNID, or model number.
I bought a lot (500+) cheap China tablet with AllWinner processor and Android 4.0.3. All tablets expose the same serial number. I can't deploy my application simultaneously on several devices (with a USB hub) using ADB.EXE because it can't distinguish them.
I'm thinking about a pre-deploy process that change the internal serial number, is it possible? Where is the serial number stored?
Note: tablets are rooted
3 Answers
You need to populate /sys/class/android_usb/android0/iSerial
sysfs file with unique values for every device. Most vendors do it with custom init script, which would read the value from a persistent system property or a regular file and put it in sysfs on every power up.
Try editing /data/misc/wifi/serialno
then reboot, it worked as a permanent solution for me
The location of this number may differ between android versions
The serial number should be stored in a file with only the serial number inside and no n
build number etc by editing the 'build.prop' file in /system. The serial number can be changed by adding the property 'ro.serialno=' to build.prop file
Adb Change Device Serial Number Mac
Not the answer you're looking for? Browse other questions tagged androidadbserial-number or ask your own question.
I have two smart phones (ZTEV788d, system Android 2.3.6) connected to a computer (Ubuntu 11.10) at the same time, using command: adb devices
I got this:
The serial numbers are the same!
I wrote an application in the computer side to communicate with these two phones, for example install app and push files.
I used these commands:
Now these two phones have the same serial no (P753A12D
), when I run these commands I get this error:
So, my questions are:
- Is that normal that two phones to have the same serial no?
- Can I change the serial no? if yes, how?
- Is there any way to run these install, push commands successfully even if the serial no are the same?
BTW, the WiFi/3G network will be turned off when I'll run the test.
7 Answers
Today I found an easy solution for this issue.
You'll get list of devices with their qualifiers
Then you can use qualifiers instead of serial numbers like this
or with transport_id
and -t
I faced the very same problem. It's because the adb tool uses the serial numbers for identification of devices connected to usb instead of their device paths (which are unique for sure).
If you feel up to getting your hands dirty, download the Android source tree, go to system/core/adb/transport.c
, change it to something like that:
type make adb
from the top level path and voila. Devices use usb paths for identification. Now you can install & execute all of the devices from Eclipse with one click.
if your device is rootedtry this way
to change serial number your devices , first connect one of them to your pc then type this in cmd
this shows your device id (serial number).
pick some new name ,for example NAME1
then type this commands
exit
exit from root exit
exit from shell
START
now unplug the usb cable and run this commands
connect your device again and type
now you can see changes
END
note : if it did not work first time
disconnect your phone and do this parts of my guide from START to END again.
1. Is that normal that two phones to have the same serial number?
The purpose of the serial number is to uniquely identify the device, so they should be different. That being said, some manufacturers don't bother. It's also possible that the firmware is reporting the number incorrectly.
You can check the serial number on the actual devices, and see if it matches what adb
is reporting.
2. Can I change the serial number? if yes, how?
Adb Change Device Serial Number Windows
There isn't an easy or consistent method for doing this that I'm aware of. Here are some examples where others have accomplished this feat (but I have not):
3. Is there any way to run these install, push commands successfully even if the serial numbers are the same?
There shouldn't be any problem running commands if only one device is connected at a time.
The answer given by @mirokropacek works for Linux (and presumably Mac, too) but doesn't work for Windows, unfortunately. This is due to the way the register_usb_transport
function is called in Windows. It turns out the devpath parameter is always NULL
in Windows. I needed to handle the same situation so I adapted the solution given above to randomly generate a device ID for each device if the serial
parameter is NULL or it is empty (zero length).
I don't need to worry about differentiating devices over long periods of time and many devices so generating a pseudo-random number for the device ID with rand
, then using sprintf
to create a string representation of that ID seems to be sufficient for my needs but YMMV. It only generates a 4-digit hex number but it works well enough for me (for now at least).
If you don't want to change the device itself, and/or don't have root access, and the device has network access, you could switch to using TCPIP instead of USB:
- Switch adb to using TCPIP:
adb tcpip 5555
- Have adb connect to the device using the network:
adb connect yourhostname
I've run this through SSH tunnels where it would connect to localhost, so all devices show up as 'localhost' which is quite unuseful. Adding hosts to /etc/hosts (that all pointed to localhost) fixed that for me.
Now newer adb
supports transport ID besides serial number:
Firstly run
You would see like below:
Now you could specify a device with
Not the answer you're looking for? Browse other questions tagged androidadb or ask your own question.
B]adb
]) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:
[bu] | B]A client ], which sends commands. The client runs on your development machine. You can invoke a client from a shell by issuing an B]adb ] command. Other Android tools such as DDMS also create B]adb ] clients. |
[bu] | B]A daemon ], which runs commands on a device. The daemon runs as a background process on each emulator or device instance. |
[bu] | B]A server ], which manages communication between the client and the daemon. The server runs as a background process on your development machine. |
If there’s only one emulator running or only one device connected, the
B]adb
] command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use the
B]-d
],
B]-e
], or
B]-s
] option to specify the target device to which the command should be directed.
-a | Directs B]adb ] to listen on all interfaces for a connection. |
-d | Directs command to the only connected USB device. Returns an error if more than one USB device is present. |
-e | Directs command to the only running emulator. Returns an error if more than one emulator is running. |
-sI]specific device ] | |
Directs command to the device or emulator with the given serial number or qualifier. Overrides B]ANDROID_SERIAL ] environment variable. | |
-pI]product name or path ] | |
Simple product name like B]sooner ], or a relative/absolute path to a product out directory like B]out/target/product/sooner ]. If B]-p ] is not specified, the B]ANDROID_PRODUCT_OUT ] environment variable is used, which must be an absolute path. | |
-H | Name of adb server host (default: B]localhost ]) |
-P | Port of adb server (default: B]5037 ]) |
adb devices [-l] | |
List all connected devices. B]-l ] will also list device qualifiers. | |
adb connectI]host ][: I]port ]] | |
Connect to a device via TCP/IP. Port B]5555 ] is used by default if no port number is specified. | |
adb disconnect [I]host ][: I]port ]]] | |
Disconnect from a TCP/IP device. Port B]5555 ] is used by default if no port number is specified. Using this command with no additional arguments will disconnect from all connected TCP/IP devices. |
Device commands
adb pushI]local ]... I]remote ] | |
Copy file/dir to device. | |
adb pull [-a]I]remote ] [ I]local ]] | |
Copy file/dir from device. B]-a ] means copy timestamp and mode. | |
adb sync [-l] [I]directory ]] | |
Copy host->device only if changed. B]-l ] means list but don’t copy. | |
If I]directory ] is not specified, B]/system ], B]/vendor ] (if present), B]/oem ] (if present) and B]/data ] partitions will be updated. | |
If it is B]system ], B]vendor ], B]oem ] or B]data ], only the corresponding partition is updated. | |
adb shell [-eI]escape ]] [-n] [-T|-t] [-x] [ I]command ]] | |
Run remote shell command (interactive shell if no command given) |
[bu] | -e: Choose escape character, or B]none ]; default B]~ ] |
[bu] | -n: Don’t read from stdin |
[bu] | -T: Disable PTY allocation |
[bu] | -t: Force PTY allocation |
[bu] | -x: Disable remote exit codes and stdout/stderr separation |
adb emuI]command ] | |
Run emulator console command | |
adb logcat [I]filter-spec ]] | |
View device log. | |
adb forward [en]list | |
List all forward socket connections. The format is a list of lines with the following format: B] BI]serial B] ' ' BI]local B] ' ' BI]remote B] [lq][rq] ] | |
adb forwardI]local ] I]remote ] | |
Forward socket connections. |
[bu] | tcp:I]port ] |
[bu] | localabstract:I]unix domain socket name ] |
[bu] | localreserved:I]unix domain socket name ] |
[bu] | localfilesystem:I]unix domain socket name ] |
[bu] | dev:I]character device name ] |
[bu] | jdwp:I]process pid ] (remote only) |
adb forward [en]no-rebindI]local ] I]remote ] | |
Same as [lq]adb forward I]local ] I]remote ][rq] but fails if I]local ] is already forwarded | |
adb forward [en]removeI]local ] | |
Remove a specific forward socket connection. | |
adb forward [en]remove-all | |
Remove all forward socket connections. | |
adb reverse [en]list | |
List all reverse socket connections from device. | |
adb reverseI]remote ] I]local ] | |
Reverse socket connections. |
[bu] | tcp:I]port ] |
[bu] | localabstract:I]unix domain socket name ] |
[bu] | localreserved:I]unix domain socket name ] |
[bu] | localfilesystem:I]unix domain socket name ] |
adb reverse [en]no-rebindI]remote ] I]local ] | |
Same as ‘adb reverse I]remote ] I]local ]’ but fails if I]remote ] is already reversed. | |
adb reverse [en]removeI]remote ] | |
Remove a specific reversed socket connection. | |
adb reverse [en]remove-all | |
Remove all reversed socket connections from device. | |
adb jdwp | |
List PIDs of processes hosting a JDWP transport. | |
adb install [-lrtsdg]I]file ] | |
Push this package file to the device and install it. | |
[bu] | B]-l ]: Forward lock application. |
[bu] | B]-r ]: Replace existing application. |
[bu] | B]-t ]: Allow test packages. |
[bu] | B]-s ]: Install application on sdcard. |
[bu] | B]-d ]: Allow version code downgrade (debuggable packages only). |
[bu] | B]-g ]: Grant all runtime permissions. |
adb install-multiple [-lrtsdpg]I]file... ] | |
Push this package file to the device and install it. | |
[bu] | B]-l ]: Forward lock application. |
[bu] | B]-r ]: Replace existing application. |
[bu] | B]-t ]: Allow test packages. |
[bu] | B]-s ]: Install application on sdcard. |
[bu] | B]-d ]: Allow version code downgrade (debuggable packages only). |
[bu] | B]-p ]: Partial application install. |
[bu] | B]-g ]: Grant all runtime permissions. |
adb uninstall [-k]I]package ] | |
Remove this app package from the device. B]-k ] means keep the data and cache directories. | |
adb bugreport [I]zipfile ]] | |
Return all information from the device that should be included in a bug report. | |
adb backup [-fI]file ]] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [ I]packages... ]] | |
Write an archive of the device’s data to I]file ]. If no B]-f ] option is supplied then the data is written to B]backup.ab ] in the current directory. |
B]-apk
] |
B]-noapk
] enable/disable backup of the .apks themselves in the archive; the default is noapk.
B]-obb
] |
B]-noobb
] enable/disable backup of any installed apk expansion (aka .obb) files associated with each application; the default is noobb.
B]-shared
] |
B]-noshared
] enable/disable backup of the device’s shared storage / SD card contents; the default is noshared.
B]-all
] means to back up all installed applications.
B]-system
] |
B]-nosystem
] toggles whether
B]-all
] automatically includes system applications; the default is to include system apps.
I]packages...
] is the list of applications to be backed up. If the
B]-all
] or
B]-shared
] flags are passed, then the package list is optional. Applications explicitly given on the command line will be included even if
B]-nosystem
] would ordinarily cause them to be omitted.
adb restoreI]file ] | |
Restore device contents from the I]file ] backup archive. | |
adb disable-verity | |
Disable dm-verity checking on USERDEBUG builds. | |
adb enable-verity | |
Re-enable dm-verity checking on USERDEBUG builds. | |
adb keygenI]file ] | |
Generate adb public/private key. The private key is stored in I]file ], and the public key is stored in I]file ].pub. Any existing files are overwritten. | |
adb help | |
Show help message. | |
adb version | |
Show version number. |
Scripting
adb wait-for-[-I]transport ]]- I]state ] | |
Wait for device to be in the given state: B]device ], B]recovery ], B]sideload ], or B]bootloader ]. I]transport ] is: B]usb ], B]local ] or B]any ] (default = B]any ]) | |
adb start-server | |
Ensure that there is a server running. | |
adb kill-server | |
Kill the server if it is running. | |
adb get-state | |
Prints: B]offline ] | B]bootloader ] | B]device ] | |
adb get-serialno | |
Prints: I]serial-number ]. | |
adb get-devpath | |
Prints: I]device-path ]. | |
adb remount | |
Remounts the B]/system ], B]/vendor ] (if present) and B]/oem ] (if present) partitions on the device read-write. | |
adb reboot [bootloader|recovery] | |
Reboots the device, optionally into the bootloader or recovery program. | |
adb reboot sideload | |
Reboots the device into the sideload mode in recovery program (adb root required). | |
adb reboot sideload-auto-reboot | |
Reboots into the sideload mode, then reboots automatically after the sideload regardless of the result. | |
adb sideloadI]file ] | |
Sideloads the given package. | |
adb root | |
Restarts the adbd daemon with root permissions. | |
adb unroot | |
Restarts the adbd daemon without root permissions. | |
adb usb | |
Restarts the adbd daemon listening on USB. | |
adb tcpipI]port ] | |
Restarts the adbd daemon listening on TCP on the specified port. |
Adb Change Device Serial Number Location
Networking
adb pppI]tty ] [ I]parameters ]] | |
Run PPP over USB. |
I]parameters
]: E.g.
B]defaultroute debug dump local notty usepeerdns
Adb Change Device Serial Number Windows 10
]
Note: you should not automatically start a PPP connection.
I]tty
] refers to the tty for PPP stream. E.g.
B]dev:/dev/omap_csmi_tty1
]
adb reconnect | |
Kick current connection from host side and make it reconnect. | |
adb reconnect device | |
Kick current connection from device side and make it reconnect. |
ADB_TRACE | |
Print debug information. A comma separated list of the following values B]1 ] or B]all ], B]adb ], B]sockets ], B]packets ], B]rwx ], B]usb ], B]sync ], B]sysdeps ], B]transport ], B]jdwp ] | |
ANDROID_SERIAL | |
The serial number to connect to. B]-s ] takes priority over this if given. | |
ANDROID_LOG_TAGS | |
When used with the logcat option, only these debug tags are printed. |