Opening Package Contents Without Installing- .PKGs
How to View Package Files with “Show Package Contents” in Mac Finder
The first method is quite easy and available from the Mac Finder, it is well-known by advanced users:
- Navigate to the package file in the Finder
- Now right-click on the pkg file and select “Show Package Contents”
However, “Show Package Contents” isn’t always displayed as an option. In fact sometimes “Show Package Contents” is not available or not showing up at all, depending on how the package was arranged and created from the get-go. In such a situation, you can then turn to the command line to extract a package file.
How to Expand a Package File on Mac by Command Line
Assuming the ‘Show Package Contents’ option is unavailable, we can extract .pkg files using a command line tool called pkgutil that is bundled with Mac OS
- Launch Terminal (found in /Applications/Utilities/) if you have not done so already
- Use the following syntax, pointing the path to the package file in question, and providing an output destination for the files to be extracted from the package
-
pkgutil --expand /path/to/package.pkg /output/destination/
Hint: recall that you can drag & drop items into the Terminal to print their full path, making this tip easier by typing:
pkgutil --expand [drop file here] /destination/path/
- Go to the outputs path in the Finder and check out the extracted files yourself, or navigate to the directly with the ‘cd’ command at the command lin
https://osxdaily.com/2011/09/26/show-package-contents-unavailable-extract-pkg-files-without-installing-them/