Install Sauce Connect on Windows
With Winget
On Windows 10 and newer you can install Sauce Connect with the builtin winget package manager. This is the recommended way to install Sauce Connect on Windows.
Install
Open Terminal and run the following command to install Sauce Connect:
winget install SauceLabs.SauceConnect
Set SC Alias
Sauce Connect for Windows installs the sauce-connect
command not sc
.
This is due to the fact that the sc
command is already used by the system.
To work around this issue, you can set an alias for the sauce-connect
command.
In Terminal run the following command to permanently set the sc
alias for sauce-connect
:
if (-Not (Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}
Add-Content -Path $PROFILE -Value "Set-Alias -Name 'sc' -Value 'sauce-connect' -Option 'AllScope' -Force"
Open a new Terminal window to use the sc
command for Sauce Connect.
Add Command Completion
In Terminal run the following script to add sc
command completion to PowerShell:
if (-Not (Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}
Add-Content -Path $PROFILE -Value "Invoke-Expression (sauce-connect completion powershell | Out-String)"
Open a new Terminal window to use the sc
command with completion.
Edit Config File
This step is optional. You can use default configuration or configure Sauce Connect with flags or environment variables. See CLI reference for more details.
Get the default configuration file:
sc run config-file > sauce-connect.yaml
Edit the configuration file with your favorite editor:
notepad sauce-connect.yaml
Start Sauce Connect
sc run --config-file sauce-connect.yaml
With Zip Package
Sauce Connect provides .zip
package that can be used on older Windows versions that do not support winget.
Unpack Zip File
mkdir C:\sauce-connect
Invoke-WebRequest -Uri https://saucelabs.com/downloads/sauce-connect/5.2.2/sauce-connect-5.2.2_windows.x86_64.zip -OutFile sauce-connect.zip
Expand-Archive -Path sauce-connect.zip -DestinationPath C:\sauce-connect
Rename-Item -Path C:\sauce-connect\sauce-connect.exe -NewName C:\sauce-connect\sc.exe
Edit Config File
This step is optional. You can use default configuration or configure Sauce Connect with flags or environment variables. See CLI reference for more details.
Get the default configuration file:
cd C:\sauce-connect
./sc.exe run config-file > sauce-connect.yaml
Edit the configuration file with your favorite editor:
notepad sauce-connect.yaml
Start Sauce Connect
./sc.exe run --config-file sauce-connect.yaml