進行状況の追跡を始めよう
Trailhead のホーム
Trailhead のホーム

Set Up Your iOS Development Environment

What You’ll Learn

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

Prerequisites

  • A Mac OS X development machine.
  • Successful completion of step 1, Install Common Components.

About the iOS Development Environment

iOS development components include:

  • Xcode
  • iOS SDK

You install Xcode and the iOS SDK as a single unit from the Mac App Store. This package also installs the iOS simulator with recent iPhone and iPad images.

The minimum versions Mobile SDK 7.1 requires are:

  • Xcode 10
  • iOS 11 SDK
Note

Note

You can’t develop iOS apps on the Windows operating system. If Windows is your development environment, skip this step—Android development is your only choice. On Windows, you must install the Android platform to do any Mobile SDK development.

Install Xcode and the iOS SDK

  1. On your Mac, open the App Store.
  2. Search the name Xcode.
  3. Click Get or Update, then, if prompted, click Install App.
  4. To install, verify, and confirm your installation, follow the prompts.
  5. When installation finished, click OPEN.
  6. Accept the Xcode and iOS SDK license agreement.
  7. To install extra components for building and debugging, follow the prompts.

The Xcode package automatically installs simulator images for recent Apple mobile devices, so you don’t have to set them up.

Good job! Your development environment for Mobile SDK is ready for iOS native app development. If you’d like to install the optional-but-recommended Mobile SDK tool for creating native iOS apps, continue to “Install Forceios”.

Install CocoaPods

CocoaPods is a third-party dependency manager required by forceios, a Mobile SDK utility. You need forceios and CocoaPods to earn the Develop with Mobile SDK badge. However, CocoaPods is optional for real-world Mobile SDK development.

To enable forceios, install CocoaPods.

  1. To check if it is already installed, type in the Terminal window: pod --version
    • If this command reports any version number from 1.2 to 1.6, you’re done—proceed to the next installation. If the reported version is not in this range, continue to step 2.
    • If you get a “command not found” error message, continue to step 2.
  2. In the Terminal window, type: sudo gem install cocoapods -v 1.6
    If you encounter problems with this installation, consult the documentation at cocoapods.org.
  3. When the installer finishes, return to step 1.

Now that you’ve installed CocoaPods, you’re ready to install forceios.

Install Forceios

For creating compatible iOS apps, Mobile SDK provides forceios, an open-source command-line utility. Forceios is the quickest and easiest way to create native Mobile SDK apps for iOS. You enter some metadata as prompted, and a few minutes later you have a fully configured Xcode project.

Note

Note

Forceios is required for the Develop with Mobile SDK badge, but it is optional for Mobile SDK iOS development. To create projects without it, see Creating an iOS Swift Project Manually.

To install forceios:

  1. Open the Terminal app.
  2. Type sudo npm install -g forceios and press Return.
  3. When prompted, enter your system password.
  4. To test your installation, type forceios version and press Return.
    For example:
    $ forceios version
    forceios version 7.0.0
  5. To get usage information for forceios, type forceios and press Return.

Good job! Now you can create a Mobile SDK app with forceios, load it into Xcode, and run it in an iOS simulator. You can continue to the Android installation step, if you haven’t done it already, or to the hybrid or React Native installation step.

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