MetaMask is a mobile web browser that provides easy access to websites that use the Ethereum blockchain.
To learn how to develop MetaMask-compatible applications, visit our Developer Docs.
The code is built using React-Native and running code locally requires a Mac or Linux OS.
Install sentry-cli tools:
brew install getsentry/tools/sentry-cli
nvm usewill automatically choose the right node version for you.
Install the shared React Native dependencies (
React Native CLI, not
Install cocoapods by running:
sudo gem install cocoapods
MetaMask Only: Rename the
.*.env.example files (remove the
.example) in the root of the project and fill in the appropriate values for each key. Get the values from another MetaMask Mobile developer.
Clone this repo and install our dependencies:
git clone ... cd metamask-mobile yarn setup # not the usual install command, this will run a lengthy postinstall flow cd ios && pod install && cd .. # install pods for iOS
cp .ios.env.example .ios.env && \ cp .android.env.example .android.env && \ cp .js.env.example .js.env
Non-MetaMask Only: Create an account and generate your own API key at Infura in order to connect to main and test nets. Fill
.js.env. (App will run without it, but will not be able to connect to actual network.)
Then, in one terminal, run:
SDK Toolstab and install NDK version
21.4.7075529. You'll need to click "Show Package Details" in order to select the appropriate version.
secret-toolbinary on your machine.
Unfortunately, the build system may fail to pick up local changes, such as installing new NPM packages or
yarn linking a dependency.
If the app is behaving strangely or not picking up your local changes, it may be due to build issues.
To ensure that you're starting with a clean slate, close all emulators/simulators, stop the
yarn watch process, and run:
yarn clean # if you're going to `yarn link` any packages, # do that here, before the next command yarn watch:clean # ...and then, in another terminal yarn start:ios # or yarn start:android
yarn link fails after going through these steps, try directly
yarn adding the local files instead.
First, make sure you have the following running:
Next, install the Flipper desktop app (verified working with v0.127.0)
npm i -g [email protected]
Finally, check that the debugger is working:
idbto be installed, which consists of 2 parts
brew tap facebook/fb&
brew install idb-companion
pip3.9 install fb-idb(This step may require that you install python3 via
python -m pip3 install --upgrade pip)
First, follow the instructions here to install
Whenever you change dependencies (adding, removing, or updating, either in
yarn.lock), there are various files that must be kept up-to-date.
yarn setupagain after your changes to ensure
yarn.lockhas been properly updated.
yarn allow-scripts autoto update the
allow-scriptsconfiguration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. Review each new package to determine whether the install script needs to run or not, testing if necessary.
yarn allow-scripts autowill behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies.
To get a better understanding of the internal architecture of this app take a look at this diagram.