Newer Version Available
Preview Components in the Salesforce Mobile App
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.
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.
- 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
- iOS
-
- In Finder, unzip the downloaded package file to extract the app file.
- Drag the app file from Finder and drop it on a running iOS simulator instance.
- On the simulator, find the app’s icon and launch the app.
- Android
-
- Drag the downloaded APK file from Mac Finder or Windows Explorer and drop it on a running Android emulator instance.
- 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.
- In VS Code, enter Command-Shift-P or Ctrl-Shift-P to launch the Command Palette.
- If you don’t have a scratch org:
- In the input field, enter SFDX: Create a Default Scratch Org, then click the matching VS Code listing.
- Follow the prompts.
- In the input field, enter SFDX: Push Source to Default Scratch Org, then click the matching VS Code listing.
- As always, watch Output in the console panel to verify that everything goes smoothly.
Verify Your Components
- Log in to the org where your component is installed.
- Inspect and verify your component’s visibility and appearance in relation to other components.
- 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.