Install the Package in a Target Org
After you create a package with the CLI, install the package in a target org. You can
install the package in any org you can authenticate, including a scratch org.
If you want to create a scratch org and set it as the defaultusername org, run this command from the project
directory.
1sf org create scratch -definition-file config/project-scratch-def.jsonTo locate the ID of the package version to install, run sf package1 version list.
1METADATAPACKAGEVERSIONID METADATAPACKAGEID NAME VERSION RELEASESTATE BUILDNUMBER
2──────────────────────── ────────────────── ──── ─────── ──────────── ───────────
304txx000000069oAAA 033xx00000007coAAA r00 1.0.0 Released 1
404txx000000069tAAA 033xx00000007coAAA r01 1.1.0 Released 1
504txx000000069uAAA 033xx00000007coAAA r02 1.2.0 Released 1
604txx000000069yAAA 033xx00000007coAAA r03 1.3.0 Released 1
704txx000000069zAAA 033xx00000007coAAA r04 1.4.0 Released 1You can then copy the package version ID you want to install. For example, the ID 04txx000000069zAAA is for version 1.4.0.
-
Install the package. You supply the package alias or version ID, which starts with 04t, in
the required --package parameter.
1sf package install --package 04txx000000069zAAAIf you’ve set a default target org, the package is installed there. You can specify a different target org with the --target-org parameter. If the package is protected by an installation key, supply the key with the --installation-key parameter.
To uninstall a package, open the target org and choose Setup. On
the Installed Packages page, locate the package and choose
Uninstall.