mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +08:00
fix: install error
This commit is contained in:
@@ -19,7 +19,6 @@ import (
|
||||
"github.com/danielpaulus/go-ios/ios/instruments"
|
||||
"github.com/danielpaulus/go-ios/ios/testmanagerd"
|
||||
"github.com/danielpaulus/go-ios/ios/tunnel"
|
||||
"github.com/danielpaulus/go-ios/ios/zipconduit"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
@@ -239,22 +238,11 @@ func (dev *IOSDevice) NewDriver() (driver IDriver, err error) {
|
||||
}
|
||||
|
||||
func (dev *IOSDevice) Install(appPath string, opts ...option.InstallOption) (err error) {
|
||||
installOpts := option.NewInstallOptions(opts...)
|
||||
for i := 0; i <= installOpts.RetryTimes; i++ {
|
||||
var conn *zipconduit.Connection
|
||||
conn, err = zipconduit.New(dev.DeviceEntry)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
err = conn.SendFile(appPath)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg(fmt.Sprintf("failed to install app Retry time %d", i))
|
||||
}
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
conn, err := installationproxy.New(dev.DeviceEntry)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = conn.Install(dev.DeviceEntry, appPath)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user