Closed wrutkowski closed 7 years ago
I'm not experiencing the "transfer closed" issue, but I do notice that if I Ctrl-C the process and run it again, it assumes an existing download is complete and attempts to mount the dmg.
When I restart it's not continuing to download, just try to mount corrupted file and exit with error. I had to retry and it finally worked, but it's not stable for some reason.
I think the issue is with my network connection. Do you think it's possible to make the downloading script more resistant for connection drops and / or automatic retry?
XcodeInstall uses some curl
flags to automatically finish any incomplete downloads for the Xcode dmgs/xips, so potentially this could be done for the simulator downloads as well.
We are getting the same issue at CircleCI:
Installing iOS 10.0
Installing iOS 10.0 Simulator for Xcode 8.3.3...
<curl progressbar>
curl: (18) transfer closed with 140524867 bytes remaining to read
Mounting DMG
hdiutil: mount failed - image not recognized
[!] Failed to invoke hdiutil.
Same issue here. xcversion
keeps mounting corrupt DMG. No recovery from network error whatsoever.
This is probably a fairly easy fix, to test copying in the same option curl uses for resuming a partial download, if anyone wants to try.
(and now that I look, I completely missed that @marcomorain has already done work towards that :)
diff --git a/lib/xcode/install.rb b/lib/xcode/install.rb
index 2a97256..65aec46 100644
--- a/lib/xcode/install.rb
+++ b/lib/xcode/install.rb
@@ -385,7 +385,7 @@ HELP
end
def install
- download unless dmg_path.exist?
+ download
prepare_package unless pkg_path.exist?
puts "Please authenticate to install #{name}..."
`sudo installer -pkg #{pkg_path} -target /`
Thanks @marcomorain 👍
Hi,
I'm experiencing the same error for a long time now and it can happen a few times in a row as in the below log.
This is the command I'm running:
xcversion simulators --install="tvOS 10.1"
And this is the log:
Thanks