Hi,
Many developers are working behind a company proxy and Xcode doesn't seem to pick up the system's settings (either with automatic or manual configuration). It makes it impossible to use SPM as Xcode is not able to fetch dependencies, getting very regularly the error message "No Route to host (-1)".
I came across some workaround like changing the java config to use the system's settings or modifying the java exec used by Xcode to specify the proxy, but Xcode 14 doesn't seem to use java anymore (or at least I can't find where the config is located now).
I also tried to set the JAVA_TOOL_OPTIONS env variable with my proxy details and with java.net.useSystemProxies=true
, with no luck.
Is there any way to configure the proxy within Xcode ? As anyone managed to make Xcode and SPM work behind a company proxy?
I'd really appreciate some help. Thanks!
What now always works for me now is (after weeks of real pain with SPM behind a corporate proxy):
On the terminal
xcodebuild -scmProvider system -resolvePackageDependencies -disablePackageRepositoryCache -workspace MyProject.xcworkspace -scheme MyScheme
On XCode after the xcodebuild finishes
XCode - File - Packages - Resolve Package Versions.
I hope this is of any help.