Mattermost Logo
We're hiring!
Edit on GitHub

Developer Setup for Mattermost Mobile Apps

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.

Note: This guide describes how to set up the development environment on macOS or Linux.

A macOS computer is required to build the Mattermost iOS mobile app.

Environment Setup 

iOS and Android 

Install the following prerequisite software to develop and build the iOS or Android apps. For macOS, we recommend using Homebrew as a package manager.

Install NodeJS 16

This includes NPM 7 which is also needed.

Known working node versions: 16.2.0

Install Cygwin (Windows only) 

Windows 10 
macOS 
  • To install using Homebrew open a terminal and execute:
    $ brew install node
Linux 
  • Install using your distribution’s package manager (Note that different distros provide different node versions, check that it is a supported NodeJS version)

Other installation options:

  • Using NVM by following the instructions here.
  • Download and install the package from the NodeJS website.
Windows 10 

Install Watchman 

The minimum required version is 4.9.0.

macOS 
  • To install using Homebrew open a terminal and execute:

    $ brew install watchman
    
Linux 
  • On Linux you have to build Watchman yourself. See the official Watchman guide.
    • Note that you need to increase your inotify limits for Watchman to work properly.
    • If you encounter a warning about a missing C++ compiler you need to install the C++ extension from your distro’s package manager (Ubuntu: g++, RHEL/Fedora: gcc-g++).
Windows 10 
  • Download the latest package from here. Note that it’s currently in Beta.

Install react-native-cli tools 

$ npm -g install react-native-cli

Install Ruby 

Windows 10 
  • Install Ruby from here

Install Git 

Windows 10 
  • Install git from here

Install bundler --version 2.0.2 gem 

$ gem install bundler --version 2.0.2

Obtaining the source code 

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:

macOS 
$ brew install git
Linux 

Some distributions come with Git preinstalled but you’ll most likely have to install it yourself. For most distributions the package is simply called git.

Additional setup for iOS 

  • Install Xcode to build and run the app on iOS. The minimum required version is 11.0.

Additional setup for Android 

Download and install Android Studio or the Android SDK command line tools

Environment Variables 

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`
macOS 
  • On Mac, this usually requires adding the following lines to your ~/.bash_profile file:

    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:

    source ~/.bash_profile
    
Linux 
  • 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

    source ~/.bash_profile
    
    • Note that depending on the shell you’re using, this might need to be put into a different file such as ~/.zshrc. Adjust this accordingly.
    • Also this documentation assumes you chose the default path for your Android SDK installation. If you chose a different path, adjust accordingly.

Installing the right SDKs and SDK Tools 

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) image

    • Android SDK Build-Tools 29.0.2
    • Android Emulator
    • Android SDK Platform-Tools
    • Android SDK Tools
    • Google Play services
    • Intel x86 Emulator Accelerator (HAXM installer)
    • Support Repository
      • Android Support Repository
      • Google Repository
  • SDK Platforms (you may have to click “Show Package Details” to expand packages) image

Obtaining the Source Code 

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.

  1. Fork the mattermost-mobile repository on GitHub.

  2. Clone your fork locally:

    • Open a terminal
    • Change to a directory you want to hold your local copy
    • Run git clone https://github.com/<username>/mattermost-mobile.git if you want to use HTTPS, or git clone git@github.com:<username>/mattermost-mobile.git if you want to use SSH

    <username> refers to the username or organization in GitHub that forked the repository

  3. Change the directory to mattermost-mobile.

    cd mattermost-mobile
    
  4. Install the project dependencies with npm install