mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix: adb device parse attributes error
This commit is contained in:
@@ -108,7 +108,7 @@ func (c Client) DeviceList() (devices []*Device, err error) {
|
||||
}
|
||||
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) < 5 || len(fields[0]) == 0 {
|
||||
if len(fields) < 4 || len(fields[0]) == 0 {
|
||||
log.Error().Str("line", line).Msg("get unexpected line")
|
||||
continue
|
||||
}
|
||||
@@ -117,6 +117,9 @@ func (c Client) DeviceList() (devices []*Device, err error) {
|
||||
mapAttrs := map[string]string{}
|
||||
for _, field := range sliceAttrs {
|
||||
split := strings.Split(field, ":")
|
||||
if len(split) == 1 {
|
||||
continue
|
||||
}
|
||||
key, val := split[0], split[1]
|
||||
mapAttrs[key] = val
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user