lightning dev app
Preview a Lightning Experience app locally and in real-time, without deploying it.
Use Local Dev to see local changes to your app in a real-time preview that you don’t have to deploy or manually refresh. To let you quickly iterate on your Lightning web components (LWCs) and pages, your app preview automatically refreshes when Local Dev detects source code changes.
When you edit these local files with Local Dev enabled, your org automatically reflects these changes.
- Basic HTML and CSS edits to LWCs
- JavaScript changes to LWCs that don't affect the component's public API
- Importing new custom LWCs
- Importing another instance of an existing LWC
To apply any other local changes not listed above, you must deploy them to your org using the sf project deploy start command.
When you make changes directly in your org (like saving new component properties), they’re automatically deployed to your live app. To update your local version of the app with those changes, you must retrieve them from your org using the sf project retrieve start command.
If you run the command without flags, it displays a list of devices for you to choose from. Then it lists the apps that it found in your local DX project for you to choose. Use the –device or –name flags to bypass the questions. The command also asks if you want to enable Local Dev in your org if it isn’t already.
To learn more about Local Dev enablement, considerations, and limitations, see the Lightning Web Components Developer Guide (https://developer.salesforce.com/docs/platform/lwc/guide/get-started-test-components.html).
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
‑‑api‑version | N/A | Type: Value Override the api version used for api requests made by this command |
‑‑device‑id | ‑i | Type: Value ID of the mobile device to display the preview if device type is set to ios or android. The default value is the ID of the first available mobile device. |
‑‑device‑type | ‑t | Type: Value Valid Values: desktop, ios, androidType of device to display the app preview. |
‑‑flags‑dir | N/A | Type: Value Import flag values from a directory. |
‑‑name | ‑n | Type: Value Name of the Lightning Experience app to preview. |
‑‑target‑org | ‑o | Type: Value Required Username or alias of the target org. Not required if the target-org configuration variable is already set. |
Preview the default app for the target org “myOrg” in a desktop environment:
Preview the app “myApp” for the target org “myOrg” in a desktop environment:
Preview the default app for target org “myOrg” on an iOS device: