Start tracking your progress
Trailhead Home
Trailhead Home

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 a Windows 7, 8, or 10 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 app or a hybrid app?
Native development requires a development environment for each mobile platform you’re supporting. Hybrid development requires a native development environment plus hybrid 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 Optional Optional

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 Mobile SDK 7.0 requires are:
  • Node.js: latest
  • npm 3.10 (installed with node.js)
  • Git command line: latest

Let’s get going with common components.

Note

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

A Mac OS X or a Windows 7, 8, or 10 development machine.

  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 installer for your operating system.
  4. When the installer finishes, return to step 1.

Install the Git Command Line

A Mac OS X or Windows development machine.

  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.
retargeting