Skip to main content

Install Common Components

What You’ll Learn

In this step, you learn:
  • The basic software used by Mobile SDK command-line scripts.
  • How to check for pre-installed common software.
  • How to install missing common software.

Prerequisites

  • A Mac OS X or  64-bit Windows 7, 8, 10, or 11 development machine.

How Mobile SDK Setup Works

When you set up a Mobile SDK development environment, how you proceed depends on several questions:

What’s the OS of your development machine? Some operating systems limit your development options. Which mobile platforms do you plan to support? iOS, Android, or both? The answer can determine the type of development machine you need. Are you developing a native, hybrid, or React Native app? Native development requires a development environment for each mobile platform you’re supporting. Hybrid development requires at least one native development environment plus hybrid components. Similarly, React Native development requires at least one native development environment plus React Native components.

All scenarios require some common components and at least one mobile platform development environment. The following matrix shows which components apply for each operating system.


Mac OS X Development Machine Windows Development Machine
Common components Required. Required.
Android native components Install one or both, depending on your requirements. Hybrid development requires at least one native environment. Required.
iOS native components Not applicable.
Hybrid components Required for hybrid development only. Required for hybrid development only.
React Native components Required for React Native development only. Required for React Native development only.

About Common Components

The common components are:

  • Node.js and the Node Package Manager (npm)
  • Git command line
You install these tools from the OS command line--Terminal window in Mac OS X, Command Prompt window in Windows. Mobile SDK provides command-line scripts that make it easy for you to install Mobile SDK and create projects of all types. You access these scripts through npm. These scripts use the git command line to download Mobile SDK resources from our open-source GitHub repos.

The minimum versions required by Mobile SDK 10.0.0 are:
  • Node.js: 12.0 to latest LTS version
  • npm 3.10 (installed with node.js)
  • Git command line: latest

Let’s get going with common components.

Note

This trail, and Mobile SDK tools such as forceios, require node.js and npm, but Mobile SDK development does not. For example, to work directly from a clone of a Mobile SDK GitHub repo, you could proceed without node.js.

Install Node.js with npm

  1. To check if node.js and npm are already installed, at the OS command prompt, type: npm -v
    • If this command reports version 3.10 or later, you’re done—proceed to the next installation. 
    • If the reported version is earlier than 3.10, continue to step 2.
    • If you get a “command not found” error message, continue to step 2.
  2. In a web browser, go to nodejs.org.
  3. Download and run the latest LTS installer for your operating system.
  4. When the installer finishes, return to step 1.

Install the Git Command Line

  1. To check if git is already installed, at the OS command prompt, type: git version
    • If this command reports a git version such as “git version 2.10.1”, you’re done. Proceed to native Android or iOS environment setup.
    • If you get a “command not found” error message, continue to step 2.
  2. Go to git-scm.com/downloads.
  3. Under Downloads, click the icon for your operating system.
  4. Run the installer.
  5. When the installer finishes, return to step 1. On Mac OS close the Terminal window and reopen it before retesting the version.
That’s it. We won’t check any of your setup. Click Verify Step to proceed to the next step in the project.
Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires