Home

Awesome

MetaMask logo

MetaMask

CI CLA

MetaMask is a mobile wallet that provides easy access to websites that use the Ethereum blockchain.

For up to the minute news, follow our Twitter or Medium pages.

To learn how to develop MetaMask-compatible applications, visit our Developer Docs.

To learn how to contribute to the MetaMask codebase, visit our Contributor Docs.

Documentation

Getting started

Using Expo (recommended)

Expo is the fastest way to start developing. With the Expo framework, developers don't need to compile the native side of the application as before, hence no need for any native enviornment setup, developers only need to download a precompiled develpoment build and run the javascript bundler. The development build will then connect with the bundler to load the javascript code.

Expo Environment Setup

Install node, yarn and watchman.

Clone the project

git clone git@github.com:MetaMask/metamask-mobile.git && \
cd metamask-mobile

Install dependencies

yarn setup:expo

Run the bundler

yarn watch

Download and install the development build

For internal developers

[SOON] For external developers (we are testing the new dev builds and will make them publicly available soon after)

Load the app

If on a simulator:

If on a physical device:

That's it! This will work for any javascript development, if you need to develop or modify native code please see the next section.

Native Development

If developing or modifying native code or installing any library that introduces or uses native code, it is not possible to use an Expo precompiled development build as you need to compile the native side of the application again. To do so, please follow the steps stated in this section.

Native Environment setup

Before running the app for native development, make sure your development environment has all the required tools. Several of these tools (ie Node and Ruby) may require specific versions in order to successfully build the app.

Setup your development environment

Building the app

Clone the project

git clone git@github.com:MetaMask/metamask-mobile.git && \
cd metamask-mobile
Firebase Messaging Setup

MetaMask uses Firebase Cloud Messaging (FCM) to enable app communications. To integrate FCM, you’ll need configuration files for both iOS and Android platforms.

Internal Contributor instructions
  1. Grab the .js.env file from 1Password, ask around for the correct vault. This file contains the GOOGLE_SERVICES_B64_ANDROID and GOOGLE_SERVICES_B64_IOS secrets that will be used to generate the relevant configuration files for IOS/Android.
  2. Install and run & start the application as documented below.
External Contributor instructions

As an external contributor, you need to provide your own Firebase project configuration files:

  1. Create a Free Firebase Project
    • Set up a Firebase project in the Firebase Console.
    • Configure the project with a client package name matching io.metamask (IMPORTANT).
  2. Add Configuration Files
    • Create/Update the google-services.json and GoogleService-Info.plist files in:
    • android/app/google-services.json (for Android)
    • ios/GoogleServices/GoogleService-Info.plist directory (for iOS)
  3. Create the correct base64 environments variables.
# Generate Android Base64 Version of Google Services
export GOOGLE_SERVICES_B64_ANDROID="$(base64 -w0 -i ./android/app/google-services.json)" && echo "export GOOGLE_SERVICES_B64_ANDROID=\"$GOOGLE_SERVICES_B64_ANDROID\"" | tee -a .js.env

# Generate IOS Base64 Version of Google Services
export GOOGLE_SERVICES_B64_IOS="$(base64 -w0 -i ./ios/GoogleServices/GoogleService-Info-example.plist)" && echo "export GOOGLE_SERVICES_B64_IOS=\"$GOOGLE_SERVICES_B64_IOS\"" | tee -a .js.env

[!CAUTION]

In case you don't provide your own Firebase project config file or run the steps above, you will face the error No matching client found for package name 'io.metamask'.

In case of any doubt, please follow the instructions in the link below to get your Firebase project config file. Firebase Project Quickstart

Install dependencies
yarn setup

Not the usual install command, this will run scripts and a lengthy postinstall flow

Running the app for native development

Run Metro bundler

yarn watch

Like a local server for the app

Run on a iOS device

yarn start:ios

Run on an Android device

yarn start:android