Skip to content

Fail when installing big ipa file #4

@jessehardy

Description

@jessehardy

When installing a big ipa file (3.3G), it will report error after uploading to PublicStaging:

device_test.go:104: receive packet: read tcp 127.0.0.1:15119->127.0.0.1:27015: wsarecv: An established connection was aborted by the software in your host machine.

It seems like lockdown connection has been closed by the phone.
A simple fix would work:
`

func (d *device) AppInstall(ipaPath string) (err error) {
if _, err = d.AfcService(); err != nil {
return err
}

stagingPath := "PublicStaging"
if _, err = d.afc.Stat(stagingPath); err != nil {
	if err != ErrAfcStatNotExist {
		return err
	}
	if err = d.afc.Mkdir(stagingPath); err != nil {
		return fmt.Errorf("app install: %w", err)
	}
}

var info map[string]interface{}
if info, err = ipa.Info(ipaPath); err != nil {
	return err
}
bundleID, ok := info["CFBundleIdentifier"]
if !ok {
	return errors.New("can't find 'CFBundleIdentifier'")
}

installationPath := path.Join(stagingPath, fmt.Sprintf("%s.ipa", bundleID))

var data []byte
if data, err = os.ReadFile(ipaPath); err != nil {
	return err
}
if err = d.afc.WriteFile(installationPath, data, AfcFileModeWr); err != nil {
	return err
}

d.lockdown = nil

if _, err = d.installationProxyService(); err != nil {
	return err
}

return d.installationProxy.Install(fmt.Sprintf("%s", bundleID), installationPath)

}

`

Add a d.lockdown = nil before loading installation proxy service.
But I'm not sure that's the best way of fixing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions