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.
-
At a Terminal window or Windows command prompt, run the
forcehybrid createcommand using the following values:Prompt (or Parameter) Value Platform ( --platform)ios,android, orios,androidApplication type ( --apptype)hybrid_localApplication name ( --appname)UserSearchPackage name ( --packagename)com.acme.usersearchOrganization ( --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:
-
Copy all files—actual and symbolic—from the
samples/usersearchdirectory of the https://github.com/forcedotcom/SalesforceMobileSDK-Shared/ repository into thewww/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\usersearchfolder also appears in your<*project_name*>\wwwfolder. Resolve the symbolic links explicitly, as shown in the following script:
-
-
Run the following command:
-
Open the
platforms/android/project folder in Android Studio (for Android) or Xcode (for iOS) by following the onscreen instructions printed by forcehybrid. -
From the
wwwfolder, openUserSearch.htmlin your code editor and delete all its contents.