This blog post is in continuation to the previous post - Salesforce DX - Using Salesforce Developer Org as Developer Hub Org (https://www.salesforce-vscode.com/2018/10/salesforce-dx-using-salesforce.html). In the previous post we had created a developer org and enabled dev hub in the org. Now in this post we will create scratch orgs which will be associated to the dev hub org we created earlier.
First let us run sfdx force:org:list and sfdx force:config:list to check the orgs we have created and associated with DX installation & the configurations associated with Salesforce DX in the machine respectively. You can see that we currently only see the entry for Dev Hub org we created in the last post.
Now we will run the scratch org creation command and associate the newly created scratch org with the developer hub.
sfdx force:org:create -a MyDevOrg -s -v mydeveloperhuborg -d 30 edition=Developer
Here -s sets the created org as the default username, -a sets an alias for for the created scratch org, -v denotes alias for the target Dev Hub org, -d sets the duration of the scratch org, in days. The valid values for this parameter are from 1-30.
If the org is created, you will see a success message on the command prompt.
We will now login into the developer org and check the Developer Hub lightning application we created in previous post. In the "All Active Scratch Orgs" tab, we see an entry for the newly created org. Clicking on the Number column link, shows detail of the new org like the org id, expiration date, created date, etc.
Open the scratch org just created by running the sfdx force:org:open command, by providing the org alias.






















