Create a Template Project

First, make sure you’ve installed Salesforce Mobile SDK using the NPM installer. For iOS instructions, see iOS Preparation. For Android instructions, see Android Preparation.

Also, download the ratchet.css file from http://goratchet.com/.

Once you’ve installed Mobile SDK, create a local hybrid project for your platform.

  1. At a Terminal window or Windows command prompt, run the forcehybrid create command using the following values:

    Prompt (or Parameter)Value
    Platform (--platform)ios, android, or ios,android
    Application type (--apptype)hybrid_local
    Application name (--appname)UserSearch
    Package name (--packagename)com.acme.usersearch
    Organization (--organization)“Acme Widgets, Inc.”
    Output directory (--outputdir)Leave blank for current directory, or enter a name to create a new subdirectory for the project

    Here’s a command line example:

  2. Copy all files—actual and symbolic—from the samples/usersearch directory of the https://github.com/forcedotcom/SalesforceMobileSDK-Shared/ repository into the www/ folder, as follows:

    • In a Mac OS X terminal window, change to your project’s root directory—./UserSearch/—and type this command:

    • In Windows, make sure that every file referenced in the <*shared repo*>\samples\usersearch folder also appears in your <*project_name*>\www folder. Resolve the symbolic links explicitly, as shown in the following script:

  3. Run the following command:

  4. Open the platforms/android/ project folder in Android Studio (for Android) or Xcode (for iOS) by following the onscreen instructions printed by forcehybrid.

  5. From the www folder, open UserSearch.html in your code editor and delete all its contents.