The following instructions apply to the mobile apps for iOS and Android built in React Native. Download the iOS version here and the Android version here. Source code can be found at the GitHub Mattermost Mobile app repository.
If you run into any issues getting your environment set up, check the Troubleshooting section in the left sidebar for common solutions.
A macOS computer is required to build the Mattermost iOS mobile app.
Install the following prerequisite software to develop and build the iOS or Android apps. For macOS, we recommend using Homebrew as a package manager.
We recommend using npm version 7 (with either Node 15 or 16). To make switching easier, many of our team use nvm to manage the npm and node versions.
patchwhile installing Cygwin.
brew install nvm
Other installation options:
The minimum required version is 4.9.0.
To install using Homebrew open a terminal and execute:
brew install watchman
inotifylimits for Watchman to work properly.
npm -g install react-native-cli
gem install bundler --version 2.0.2
We use GitHub to host the source code so we recommend that you install Git. Optionally, you can also contribute by submitting pull requests. If you do not have Git installed you can do so with Homebrew by opening a terminal and executing:
brew install git
Some distributions come with Git preinstalled but you’ll most likely have to install it yourself. For most distributions the package is simply called
cocoapodspoint, then stop.
sudo xcode-select --switch /Applications/Xcode.app
mattermost-mobile/iosdirectory and run:
sudo arch -x86_64 gem install ffi sudo gem install cocoapods arch -x86_64 pod install
Download and install the Android Studio app or the Android SDK command line tools
Make sure you have the following ENV VARS configured:
- `ANDROID_HOME` to where Android SDK is located (likely `/Users/<username>/Library/Android/sdk` or `/home/<username>/Android/Sdk`) - Make sure your `PATH` includes `ANDROID_HOME/tools` and `ANDROID_HOME/platform-tools`
On Mac, this usually requires adding the following lines to your
export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH
Then reload your bash configuration:
On Linux the home folder is located under
/home/<username> which results in a slightly different path:
export ANDROID_HOME=/home/<username>/Android/Sdk export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/tools:$PATH
Then reload your configuration
~/.zshrc. Adjust this accordingly.
In the SDK Manager using Android Studio or the Android SDK command line tool, ensure the following are installed:
SDK Tools (you may have to click “Show Package Details” to expand packages)
SDK Platforms (you may have to click “Show Package Details” to expand packages)
In order to develop and build the Mattermost mobile apps, you’ll need to get a copy of the source code. Forking the
mattermost-mobile repository will also make it easy to contribute your work back to the project in the future.
Fork the mattermost-mobile repository on GitHub.
Clone your fork locally:
git clone https://github.com/<username>/mattermost-mobile.gitif you want to use HTTPS, or
git clone email@example.com:<username>/mattermost-mobile.gitif you want to use SSH
<username> refers to the username or organization in GitHub that forked the repository
Change the directory to
Install the project dependencies with
ios targets and using
nvm to manage
node, you may encounter an error like:
The following build commands failed: PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/user/Library/Developer/Xcode/DerivedData/Mattermost-ahgfkbexhhzwuycanwlxiauwkxlt/Build/Intermediates.noindex/ArchiveIntermediates/Mattermost/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/FBReactNativeSpec.build/Script-46EB2E0002D370.sh (in target 'FBReactNativeSpec' from project 'Pods') (1 failure) [08:00:31]: Exit status: 65
Check the following things:
nvmusing the Upgrade Instructions
echo v16.2.0 > ~/.nvmrc