Skip to main content

Test apps locally

Caution

The Next-Gen Dev Platform is currently rolling out to partners. The following article applies only to organizations that have completed the migration.

Visit our dev community to discuss the Next-Gen Dev Platform and provide feedback.

Note

With the Next-Gen Dev Platform, app dev allows previewing changes to your app configuration and extensions, fully isolated on your chosen development store.

Read more about the improvements to app dev

The app dev command lets you test your app changes in real-time on a development store without deploying. This enables you to iterate quickly while developing extensions, modifying app configuration, and building app functionality.

Terminal

shopify app dev

To preview your app on a development store, Shopify CLI prompts you to select a development 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 extensions or CLI-managed configuration, it creates an app preview on your chosen development store, and a file watcher to sync local changes with that app preview.
  • For apps with web files, such as those based on the Remix 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 development 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.

When 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

shopify app dev clean

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 dev isn'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.

You can reset the active organization, app instance, and store used by app dev via the --reset flag:

Terminal

shopify app dev --reset

Anchor to Develop and test apps as a teamDevelop and test apps as a team

Because changes are isolated to a single development store, app development teams can safely share a single development instance of an app. The recommended approach for app development teams is:

Anchor to Step 1: Create a shared development app instanceStep 1: Create a shared development app instance

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.

Note

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:

  1. Create your own development store in the Dev Dashboard.

    Note

    The app dev command will push configuration and extension changes to your chosen development store. It's important to have your own store, so that you can work in isolation from other team members.

  2. If necessary, switch to the development configuration of your app with app config use.

  3. Run app dev and choose your development 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.

BehaviorDev PlatformPartner Dashboard
Isolation of changesChanges made during app dev are visible only to the chosen development store.Changes made during app dev were visible to any development store in the organization.
App URL updatesUpdates the app preview to use the current tunnel or localhost URL, only for the chosen development 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 configurationAll changes to app configuration are available in the app preview.Changes to app configuration required app deploy.
Inclusion of new and removed extensionsAdding and removing extensions updates the app preview.The app dev command required a restart when extensions were added or removed.
Shopify plan supportSupports any Shopify plan that is available for development stores.Full support for Partner Test stores, partial support for Plus Sandbox stores.
App installationThe app is automatically installed on the chosen development store.You needed to install the app manually.
Access scopesChanges to access scopes are automatically accepted on the chosen development store.You had to app deploy and accept the scope changes.
Shutdown behaviorThe app preview remains active on the development store.The development store reverted to the current released version of the app.

Objects with references to extensions not in this version were non-functional.
App preview statusThe Dev Console in Shopify admin alerts you of active app previews.There was no indication of an active preview.

Was this page helpful?