2

I am currently working with multiple android builds on different hardware. I am having an issue where they all have the same serial number, 0123456789ABCDEF. This makes it impossible to use adb when I connected to two or more devices at once, because the adb doesn't know which one to talk to. I know that the name is being pulled from /sys/class/android_usb/android0/iSerial and if I wanted to I could change it there once the build is complete. Ideally though, I want that file to be set during the build depending on the build settings. I want to know where that file is being generated during the build. I believe it's being set either somewhere in barebox or in /system/core/adb, but have had no luck on the things I've tried editing.

If anyone has ran into this, any help would be greatly appreciated.

Edit: Found the solution.

This can be found in /device/company_name/device_name/init.device_name.usb.rc

on boot
    write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
    write /sys/class/android_usb/android0/iProduct ${ro.product.model}
    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
    echo "ro.serialno is ${ro.serialno}"
    write /sys/class/android_usb/android0/idVendor 0451
    write /sys/class/android_usb/android0/idProduct D101
    ..."

Change the ro.serialno to whatever you'd like.

  • possible duplicate of [Same serial number on several android devices. Adb is useless. How can I change the serial number?](http://stackoverflow.com/questions/14334656/same-serial-number-on-several-android-devices-adb-is-useless-how-can-i-change) – Alex P. Jul 16 '15 at 17:14
  • Not a duplicate. They never answer how to solve the problem. I did find it though. The file is generated in /device///init..usb.rc – confusedProgrammer Jul 16 '15 at 18:06

0 Answers0