Adb Change Device Serial Number

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

Seraphim'sSeraphim's

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/serialnothen 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

moumou

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:

  1. Is that normal that two phones to have the same serial no?
  2. Can I change the serial no? if yes, how?
  3. Is there any way to run these install, push commands successfully even if the serial no are the same?
Adb

BTW, the WiFi/3G network will be turned off when I'll run the test.

AlenAlen

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.

Miro KropacekMiro Kropacek

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.

Windows

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.

Community

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).

melstonmelston

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:

  1. Switch adb to using TCPIP: adb tcpip 5555
  2. 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

XiaoXiao

Not the answer you're looking for? Browse other questions tagged androidadb or ask your own question.

WARNING: This manual might be outdated, please refer to the official documentation.
Android Debug Bridge (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 anB]adb] command. Other Android tools such as DDMS also createB]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, theB]adb] command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use theB]-d],B]-e], orB]-s] option to specify the target device to which the command should be directed.
-aDirects B]adb] to listen on all interfaces for a connection.
-dDirects command to the only connected USB device. Returns an error if more than one USB device is present.
-eDirects 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 likeB]out/target/product/sooner]. IfB]-p] is not specified, theB]ANDROID_PRODUCT_OUT] environment variable is used, which must be an absolute path.
-HName of adb server host (default: B]localhost])
-PPort 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) andB]/data] partitions will be updated.
If it is B]system],B]vendor],B]oem] orB]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]; defaultB]~]
[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]serialB] ' 'BI]localB] ' 'BI]remoteB] [lq][rq]]
adb forwardI]local]I]remote]
Forward socket connections.
Forward specs are one of:
[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 ifI]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.
Reverse specs are one of:
[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 ifI]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 noB]-f] option is supplied then the data is written toB]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 whetherB]-all] automatically includes system applications; the default is to include system apps.
I]packages...] is the list of applications to be backed up. If theB]-all] orB]-shared] flags are passed, then the package list is optional. Applications explicitly given on the command line will be included even ifB]-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 inI]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], orB]bootloader].I]transport] is:B]usb],B]local] orB]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) andB]/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.Adb Change Device Serial NumberB]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] orB]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.

Adb Change Device Serial Number

The Android Open Source Project.

Comments are closed.