|
7 | 7 | "encoding/json" |
8 | 8 | "fmt" |
9 | 9 | "io" |
| 10 | + "net/http" |
| 11 | + "net/url" |
10 | 12 | "os" |
11 | 13 | "os/signal" |
12 | 14 | "path" |
@@ -145,6 +147,8 @@ Options: |
145 | 147 | > connect a device and open Xcode |
146 | 148 | --rsd-port=<port> Port of remote service discovery on the device through the tunnel |
147 | 149 | > This parameter is similar to '--address' and can be obtained by the same log filter |
| 150 | + --proxyurl=<url> Set this if you want go-ios to use a http proxy for outgoing requests, like for downloading images or contacting Apple during device activation. |
| 151 | + > A simple format like: "http://PROXY_LOGIN:PROXY_PASS@proxyIp:proxyPort" works. Otherwise use the HTTP_PROXY system env var. |
148 | 152 |
|
149 | 153 | The commands work as following: |
150 | 154 | The default output of all commands is JSON. Should you prefer human readable outout, specify the --nojson option with your command. |
@@ -291,6 +295,15 @@ The commands work as following: |
291 | 295 | printVersion() |
292 | 296 | return |
293 | 297 | } |
| 298 | + proxyUrl, _ := arguments.String("--proxyurl") |
| 299 | + if proxyUrl == "" { |
| 300 | + proxyUrl = os.Getenv("HTTP_PROXY") |
| 301 | + } |
| 302 | + if proxyUrl != "" { |
| 303 | + parsedUrl, err := url.Parse(proxyUrl) |
| 304 | + exitIfError("failed parsing proxy url", err) |
| 305 | + http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(parsedUrl)} |
| 306 | + } |
294 | 307 |
|
295 | 308 | b, _ := arguments.Bool("listen") |
296 | 309 | if b { |
@@ -1115,6 +1128,7 @@ func imageCommand1(device ios.DeviceEntry, arguments docopt.Opts) bool { |
1115 | 1128 | if err != nil { |
1116 | 1129 | log.WithFields(log.Fields{"basedir": basedir, "udid": device.Properties.SerialNumber, "err": err}). |
1117 | 1130 | Error("failed downloading image") |
| 1131 | + return false |
1118 | 1132 | } |
1119 | 1133 |
|
1120 | 1134 | log.WithFields(log.Fields{"basedir": basedir, "udid": device.Properties.SerialNumber}).Info("success downloaded image") |
|
0 commit comments