Usually iosDevices have a 40 character USB serial which equals the usbSerial used in usbmuxd, Xcode etc. There is an exception, some devices like the Xr and Xs have a 24 character USB serial. Usbmux, Xcode etc. however insert a dash after the 8th character in this case. To be compatible with other M
(usbSerial string)
| 239 | //however insert a dash after the 8th character in this case. To be compatible with other MacOS X and iOS tools, |
| 240 | //we insert the dash here as well. |
| 241 | func Correct24CharacterSerial(usbSerial string) string { |
| 242 | usbSerial = strings.Trim(usbSerial, "\x00") |
| 243 | if len(usbSerial) == 24 { |
| 244 | return fmt.Sprintf("%s-%s", usbSerial[0:8], usbSerial[8:]) |
| 245 | } |
| 246 | return usbSerial |
| 247 | } |
| 248 | |
| 249 | const sixteenTimesZero = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" |
| 250 |
no outgoing calls
no test coverage detected