Building Apps Locally with the Smartface CLI
You can generate Smartface iOS and Android binaries in your local environment. For the Android builds, you can use Linux or macOS. For iOS builds, macOS is required.
You can export native iOS and Android projects using the Smartface Command Line Tool(CLI) from your Smartface Cloud IDE workspace.
Before installing the Smartface Command Line Tool, please check the requirements on npm.

Installing the Smartface Command Line Tool

You can use the following shell commands to install the Smartface CLI. You can use either yarn or npm:
Bash
1
// install the latest stable Smartface cli version
2
yarn global add smartface
3
4
// install it with npm
5
npm i -g smartface
6
7
// install the latest beta Smartface cli version
8
yarn global add [email protected]
9
10
// install a specific Smartface cli version
11
yarn add global [email protected]
12
13
// check Smartface cli version
14
smfc -v
Copied!

Generating platform-based native projects from the Smartface Cloud IDE

You can use the following shell commands to export your Smartface project as Xcode and Android Studio projects:
Bash
1
// Generate Android Studio Project
2
smfc --task=export:Android --projectRoot=$WORKSPACE_FOLDER --tempFolder=$TEMP_FOLDER
3
4
// Generate Xcode Project
5
smfc --task=export:iOS --projectRoot=$WORKSPACE_FOLDER --outputZip=$OUTPUT_ZIP_FILE
Copied!

Requirements for iOS Builds

The build be run in a compatible Xcode version due to framework dependencies. Please check the xcodeversion file under the output folder to find out the Xcode version compatible with your project.

Requirements for Android Builds

Prerequisites:
Please make sure that the environment variables are set correctly:
Bash
1
javac -v
2
echo $ANDROID_HOME
3
echo $ANDROID_NDK_HOME
Copied!
After the completion of the prerequisites and the installation of the Smartface CLI, you can generate APK files in your local environment or in your Smartface Cloud workspace.
Bash
1
// Generate Android Studio project
2
smfc --task=export:Android --projectRoot=$WORKSPACE_FOLDER --tempFolder=$TEMP_FOLDER
3
4
// Navigate to gradlew folder
5
cd $TEMP_FOLDER/SmartfacePlayer
6
7
// Build APK file
8
// module: app
9
// variant: playerProdRelease
10
./gradlew app:assemblePlayerProdRelease
Copied!
Last modified 7mo ago