feat: get androidsystemVersion with gadb

This commit is contained in:
lilong.129
2025-03-06 13:28:04 +08:00
parent a6fce6a13b
commit 5b503a4394
3 changed files with 38 additions and 6 deletions
+22 -3
View File
@@ -9,6 +9,9 @@ import (
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var devices []*Device
@@ -17,9 +20,7 @@ func setupDevices(t *testing.T) {
var err error
setupClient(t)
devices, err = adbClient.DeviceList()
if err != nil {
t.Fatal(err)
}
require.Nil(t, err)
}
func TestDevice_State(t *testing.T) {
@@ -119,6 +120,24 @@ func TestDevice_DeviceInfo(t *testing.T) {
}
}
func TestDevice_SdkVersion(t *testing.T) {
setupDevices(t)
for _, device := range devices {
sdkVersion, err := device.SdkVersion()
assert.Nil(t, err)
t.Log(device.Serial(), sdkVersion)
}
}
func TestDevice_SystemVersion(t *testing.T) {
setupDevices(t)
for _, device := range devices {
systemVersion, err := device.SystemVersion()
assert.Nil(t, err)
t.Log(device.Serial(), systemVersion)
}
}
func TestDevice_Forward(t *testing.T) {
setupDevices(t)