After debugging multiple mobile phones in the company, two mobile phones are connected to the computer through USB at the same time for comparison. Suddenly I found that the serial numbers of the two mobile phones were identical when I used the ADB devices command. Because this is the same machine in the company .... This makes it impossible to connect at the same time.
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB Devices
List of devices attached
19761202 Device
19761202 Device
You must modify this number to make a difference ....
Based on experience, I searched for "19761202" in the compiled rootfs"
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/out/target/product/xxxxxxx/root $ grep-Nr "19761202" -- color.
./Init. XXXXXXX. USB. RC: 4: Write/sys/class/android_usb/android0/iserial 19761202
It turned out to be like this ....
Then, just modify the Sys File...
Connect to a machine first, and ADB root goes in...
Root @ Android:/sys/class/android_usb/android0 # Cat iserial
19761202
Root @ Android:/sys/class/android_usb/android0 #
Root @ Android:/sys/class/android_usb/android0 # echo 19761203> iserial
Root @ Android:/sys/class/android_usb/android0 # Cat iserial
19761203
Root @ Android:/sys/class/android_usb/android0 #
Modified successfully!
Now connect the two machines, and then ADB devices it!
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB Devices
List of devices attached
19761202 Device
19761202 Device
Why haven't I changed ???
Three seconds later...
Experience tells me... This should be related to ADB's host service... Kill it first!
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB kill-Server
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB Devices
* Daemon not running. Starting it now on port 5037 *
* Daemon started successfully *
List of devices attached
19761202 Device
19761203 Device
Oh yeah! Done!
Then you can use the-S parameter of ADB to connect to these machines at the same time.
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB-s 19761202 Root
Restarting adbd as root
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB-s 19761202 Shell
Root @ Android :/#
In another terminal:
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB-s 19761203 Root
Restarting adbd as root
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB-s 19761203 Shell
Root @ Android :/#