Skip to main content

Set Up Your Hybrid Development Environment

What You’ll Learn

In this step, you’ll learn:
  • The software setup required for hybrid development.
  • How to check for preinstalled software.
  • How to install missing software.

Prerequisites

  • Successful completion of step 1, Install Common Requirements.
  • One of the following:
    • A macOS X development machine and successful completion of step 2, Install the Android Development Environment, or step 3, Install the iOS Development Environment, or both.
    • A Windows development machine and successful completion of step 2, Install the Android Development Environment.

About the Hybrid Development Environment

If you’ve made it this far, congratulations! You’re ready to create native apps for Android, iOS, or both. You’re also perfectly positioned to install the tools for developing Mobile SDK hybrid apps.

Hybrid development requires the Mobile SDK common software and at least one native development environment—Android on Windows; Android, iOS, or both on macOS X. If you jumped into this project here, without doing any of the previous steps, go back and start at step 1, Install Common Components. Continue to at least one native development installation before returning here.

Once you’ve installed either the Android or the iOS development environment, enabling the hybrid option is easy. The only missing pieces are the Cordova command-line interface (CLI), Salesforce CLI, and the forcehybrid npm utility.

You can develop hybrid apps on either Mac or Windows development machines, but you can’t do in-depth iOS development on a Windows machine.

Install Cordova

  1. To check if Cordova is already installed, at the OS command prompt type cordova -version and press Return.
    • If this command reports version 11.0.0 or later, proceed to step 5. If it reports an earlier version, continue to the next step.
    • If you get a “command not found” error message, continue to step 2.
    • If Cordova prompts you to configure telemetry, indicate whether you agree to allow this Cordova feature. Cordova telemetry is a reporting tool that collects data about your usage of Cordova. See Apache Cordova CLI Privacy Policy.
  2. Install the required version.
    1. On a Mac, type sudo npm install -g cordova
    2. On Windows, type npm install -g cordova
  3. When the installer finishes, if Cordova hasn't already prompted you about telemetry as described in step 1, type cordova telemetry off or cordova telemetry on
  4. Return to step 1 to verify your installation.

Install Salesforce CLI

  1. To check if Salesforce CLI is already installed, at the OS command prompt type sf version and press Return.
    • If you see a version report such as the following, skip to Install Forcehybrid.
    • $ sf version
      sf-cli/7.94.3-a4e7c7955b darwin-x64 node-v14.15.4
    • If you get a “command not found” error message, continue to step 2.
  2. To install Salesforce CLI:
    • On a Mac, type sudo npm install -g sf-cli and press Return. If prompted, enter your system password.
    • On Windows, type npm install -g sf-cli and press Return.
  3. Return to step 1 to verify your installation.

Install Forcehybrid

  1. To install forcehybrid:
    • On a Mac, type sudo npm install -g forcehybrid and press Return. If prompted, enter your system password.
    • On Windows, type npm install -g forcehybrid and press Return.
  2. To verify your installation, type forcehybrid version and press Return. For example:
    $ forcehybrid version 
    forcehybrid version 10.0.0 
    Your command-line printout should reflect the Mobile SDK version—currently, forcehybrid version 10.x.x.

Congratulations! If you’ve completed this step, you’re ready to create hybrid apps. To get started, use the forcehybrid create command and specify either hybrid_local , hybrid_remote , or hybrid_lwc as the app type.

Remember, if you installed only one native development environment, you can come back at any time to install the other one. Just check to be sure that your current Mobile SDK components are up to date with the versions listed in this project.

We won’t check any of your setup. Click Verify Step.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities