First you need the Package Id for your package. Package details can be obtained as follows:
sfdx force:package:version:report -p YOUR_PACKAGE_NAME
Ensure your sfdx-project.json
has the Package ID and not the Subscriber Package Version Id set in this section:
"packageAliases": {
"YOUR_PACKAGE_NAME": "YOUR_PACKAGE_ID"
}
To create a new version follow this procedure:
-
Initiate a create version job:
sfdx force:package:version:create -p "YOUR_PACKAGE_NAME" -x -f config/project-scratch-def.json
Grab the JOB ID.
-
Monitor the job (the JOB ID will be output from the create command above):
sfdx force:package:version:create:report -i 08c46000000TND6AAO
Replace
08c46000000TND6AAO
with the JOB ID from step 1. -
Using the install URL output from the report command, go to the org where you wish to install it and append the URL to the orgs URL. Note that sandbox orgs (test.salesforce.com) will have the installer replicated up to 10 minutes later than the default org (login.salesforce.com).
The URL will look similar to this:
/packaging/installPackage.apexp?p0=04t460000023dbMAAQ
The last section after
p0=
is your SUBSCRIBER PACKAGE ID.To see a list of existing release URLs:
sfdx force:package:version:list
To install an older version, copy the SUBSCRIBER PACKAGE ID into the URL as shown above.