Introduction
This article provides a detailed guide on how to install Google Chrome outside of the Applications folder on a MacBook to prevent automated OS patching from upgrading the Chrome version. This is useful for Selenium tests, where a fixed Chrome version is required.
Why Install Chrome Outside the Applications Folder?
By default, Google Chrome is installed in the Applications folder on a MacBook. However, automated OS patching can upgrade the Chrome version, which might break Selenium tests that rely on a fixed Chrome version.
Preventing Automated OS Patching
One way to prevent automated OS patching from upgrading the Chrome version is to install Chrome outside of the Applications folder. This way, the automated OS patching will not affect the Chrome version that is being used for testing.
Installing Chrome Outside the Applications Folder
To install Chrome outside of the Applications folder, follow these steps:
Step 1: Download Google Chrome
Go to Google Chrome's download page and download the latest version of Google Chrome.
Step 2: Extract the Google Chrome DMG File
Once the DMG file is downloaded, open the Terminal application and navigate to the directory where the DMG file is located.
$ cd /path/to/downloads
Use the hdiutil command to extract the DMG file:
$ hdiutil attach GoogleChrome.dmg
This will mount the DMG file and create a new volume in the Finder.
Step 3: Copy Google Chrome to a Different Directory
Use the cp command to copy the Google Chrome application to a different directory, such as the ~/Applications directory:
$ cp -R /Volumes/Google\ Chrome/Google\ Chrome.app ~/Applications
This will copy the Google Chrome application to the ~/Applications directory.
Step 4: Unmount the Google Chrome DMG File
Use the hdiutil command to unmount the Google Chrome DMG file:
$ hdiutil detach /Volumes/Google\ Chrome
This will unmount the Google Chrome DMG file and remove the volume from the Finder.
Launching Google Chrome
To launch the Google Chrome application that was installed outside of the Applications folder, use the open command:
$ open ~/Applications/Google\ Chrome.app
This will launch the Google Chrome application from the ~/Applications directory.
hdiutilis a command-line utility for working with disk images on macOS.- The
cpcommand is used to copy files and directories in macOS. - The
opencommand is used to open files and applications in macOS.