Test apps locally
With the Next-Gen Dev Platform, app dev allows previewing changes to your app configuration and extensions, fully isolated on your chosen dev store.
The app dev command lets you test your app changes in real-time on a dev store without deploying.
This enables you to iterate quickly while developing extensions, modifying app configuration, and building app functionality.
Terminal
Anchor to Overview of ,[object Object]Overview of app dev
app devTo preview your app on a dev store, Shopify CLI prompts you to select a dev store to use for testing. If you have only one store, then it's selected automatically.
While running, app dev performs the following tasks:
- For apps with local app configuration and/or extensions, it creates an app preview on your chosen dev store, and a file watcher to sync local changes with that app preview.
- For apps with web files, such as those based on the React Router app template, it serves your self-hosted embedded app.
- For apps with extensions that support browser-based preview, such as UI extensions, it starts a local development server for hot module reloading.
- It serves a reverse proxy that routes to these local servers.
- It sets up external networking for that proxy server.
- If enabled in your app config, it updates your app URL to reflect the current tunnel or localhost URL.
- This change is isolated to the chosen dev store and does not affect the app URL on other stores.
- It serves GraphiQL for the Admin API using your app's credentials and access scopes.
Anchor to When ,[object Object], stopsWhen app dev stops
app dev stopsWhen you stop the app dev command, the app preview remains on your store. Your app configuration and extensions will remain active there, unless you run app dev clean:
Terminal
The app dev clean command restores the active released version of your app on your store. If any extensions or configuration are removed in this process, their related data is deleted as well. For example:
- A Discount function you added during
app devisn't in the active app version. Any discounts referencing it are deleted. - A UI extension you placed and configured via the Checkout Editor isn't in the active app version. This placement and configuration are deleted.
Anchor to Reset ,[object Object], configurationReset app dev configuration
app dev configurationYou can reset the active organization, app instance, and store used by app dev via the --reset flag:
Terminal
Anchor to Develop and test apps as a teamDevelop and test apps as a team
Because changes are isolated to a single dev store, app development teams can safely share a single development instance of an app. The recommended approach for app development teams is:
If necessary, create a development instance and configuration file for your app using app config link.
This development instance will be shared by all team members.
For safety, Shopify recommends that the default shopify.app.toml file is used for your development instance.
Anchor to Step 2: Onboard individual team membersStep 2: Onboard individual team members
As a team member, you should:
-
Create your own dev store in the Dev Dashboard.
NoteThe
app devcommand will push configuration and extension changes to your chosen dev store. It's important to have your own store, so that you can work in isolation from other team members. -
If necessary, switch to the development configuration of your app with
app config use. -
Run
app devand choose your dev store:Terminal
shopify app dev
Anchor to Changes introduced in the Next-Gen Dev PlatformChanges introduced in the Next-Gen Dev Platform
With the Next-Gen Dev Platform, the app dev command significantly improves the experience, safety, and functionality of testing your app locally.
| Behavior | Dev Platform | Partner Dashboard |
|---|---|---|
| Isolation of changes | Changes made during app dev are visible only to the chosen dev store. | Changes made during app dev were visible to any dev store in the organization. |
| App URL updates | Updates the app preview to use the current tunnel or localhost URL, only for the chosen dev store. The URL is visible in CLI output and the Dev Console in Shopify admin. It's not updated in the shopify.app.toml. | Updated the app URL for all installed shops and in the shopify.app.toml. |
| Inclusion of app configuration | All changes to app configuration are available in the app preview. | Changes to app configuration required app deploy. |
| Inclusion of new and removed extensions | Adding and removing extensions updates the app preview. | The app dev command required a restart when extensions were added or removed. |
| Shopify plan support | Supports any Shopify plan that is available for dev stores. | Full support for Partner Test stores, partial support for Plus Sandbox stores. |
| App installation | The app is automatically installed on the chosen dev store. | You needed to install the app manually. |
| Access scopes | Changes to access scopes are automatically accepted on the chosen dev store. | You had to app deploy and accept the scope changes. |
| Shutdown behavior | The app preview remains active on the dev store. | The dev store reverted to the current released version of the app. Objects with references to extensions not in this version were non-functional. |
| App preview status | The Dev Console in Shopify admin alerts you of active app previews. | There was no indication of an active preview. |