out, cancel, err := ID.XCTest(bundleID)
if err != nil {
log.Fatal(err)
}
done := make(chan os.Signal, 1)
signal.Notify(done, os.Interrupt)
go func() {
for s := range out {
fmt.Print(s)
has := strings.Contains(s, "Using singleton test manager")
if has {
driver, _ := gwda.NewUSBDriver(nil)
driver.PressButton(gwda.DeviceButtonHome)
driver.SiriActivate("What's the weather like today")
}
}
}()
<-done
cancel()
gidevice 开启 XCTest 确认连接状态使用 gwda控制
或者有更好的办法么?