Newer Version Available

This content describes an older version of this product. View Latest

Preview Components in the Salesforce Mobile App

To verify your Lightning web components in Salesforce on many devices, use virtual device builds of the Salesforce mobile app. These builds make it possible to run Salesforce on iOS simulators and Android emulators.

You can always inspect your components in Salesforce on physical mobile devices. However, if you’re testing a great variety of models, you could quickly deplete your hardware budget. To test more efficiently, run Salesforce virtual device builds on virtual representations of iOS and Android devices.

Virtual device builds come in packages that you can drop onto a running instance of an iOS simulator or an Android emulator. To obtain simulators and emulators, install each platform’s development environment: Xcode for iOS, and Android Studio for Android. You can run Salesforce on any supported simulator or emulator provided with these environments. The device you choose must be running iOS 12 or later, or Android 7.0 or later.

Salesforce has tested the Salesforce Android version on Google and Samsung devices, and the iOS version on iPhones and iPads. For a list of tested devices, see “Requirements for the Salesforce App” in Salesforce Help.

Salesforce mobile app isn’t the only Salesforce app that supports virtual device builds. For example, you can also use the following instructions with Salesforce Field Service.

Tip

Install Xcode and Simulators

If you haven’t installed Xcode 12, see Install Xcode. Salesforce mobile app requires Xcode 12 or later.

After you’ve installed Xcode 12, verify your system environment. See Verify Your iOS Setup.

Install Android Studio and Emulators

If you haven’t installed Android Studio and Android emulators, see Install Android Studio.

After you’ve installed Android Studio, verify your system environment. See Verify Your Android Studio Setup.

Download iOS and Android Mobile App Packages

To obtain virtual device builds, you download the mobile app package files that contain them. For iOS, the package is a ZIP file. For Android, it’s an APK file. The packages are publicly available, don’t require you to log in, and don’t automatically expire.

To download packages for other apps (like Salesforce Field Service), substitute the package download URL and the iOS app file name as specified in the other app’s documentation.

Note

iOS
Package (ZIP) file download: sfdc.co/salesforce-mobile-app-ios-simulator
Extracted file name: Chatter.app
Android
Package (APK) file download: sfdc.co/salesforce-mobile-app-android-emulator

Install iOS and Android Virtual Device Builds

You can use Android builds on Mac and Windows operating systems. You can use iOS builds on Mac. Install the virtual device build on each simulator or emulator you intend to use.
iOS
  1. In Finder, unzip the downloaded package file to extract the app file.
  2. Drag the app file from Finder and drop it on a running iOS simulator instance.
  3. On the simulator, find the app’s icon and launch the app.
Android
  1. Drag the downloaded APK file from Mac Finder or Windows Explorer and drop it on a running Android emulator instance.
  2. On the emulator, find the app’s icon and launch the app.

Install Your Component in a Salesforce Org

You can develop Lightning web components in a Salesforce CLI (SFDX) project. If you’re new to SFDX projects for Lightning Web Components, get started quickly with this Trailhead project.

From VS Code, it’s easy to install your component in a scratch org.

  1. In VS Code, enter Command-Shift-P or Ctrl-Shift-P to launch the Command Palette.
  2. If you don’t have a scratch org:
    1. In the input field, enter SFDX: Create a Default Scratch Org, then click the matching VS Code listing.
    2. Follow the prompts.
    3. In the input field, enter SFDX: Push Source to Default Scratch Org, then click the matching VS Code listing.
    4. As always, watch Output in the console panel to verify that everything goes smoothly.

Verify Your Components

  1. Log in to the org where your component is installed.
  2. Inspect and verify your component’s visibility and appearance in relation to other components.
  3. Inspect the Salesforce web view by attaching Safari (iOS) or Chrome (Android) developer tools to the virtual device.

See Debug Your Components with Virtual Device Builds for detailed instructions.