Skip to content

Fix failure on installing large ipa: send packet (afc): write unix ->…#45

Open
larryhou wants to merge 1 commit intoelectricbubble:mainfrom
larryhou:main
Open

Fix failure on installing large ipa: send packet (afc): write unix ->…#45
larryhou wants to merge 1 commit intoelectricbubble:mainfrom
larryhou:main

Conversation

@larryhou
Copy link

@larryhou larryhou commented Dec 12, 2023

Fix failure on installing large ipa, in my case the file size is greater than 4GB
send packet (afc): write unix ->/var/run/usbmuxd: write: broken pipe

Comment on lines +417 to 420
if r, err := os.Open(ipaPath); err != nil {return err} else {
defer r.Close()
if err = d.afc.WriteFile(installationPath, r, AfcFileModeWr); err != nil {return err}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 It would be better to close the file as soon as possible

	_ipaFile, err := os.Open(ipaPath)
	if err != nil {
		return err
	}
	if err = d.afc.WriteFile(installationPath, _ipaFile, AfcFileModeWr); err != nil {
		_ipaFile.Close()
		return err
	}
	_ipaFile.Close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants