MetaMask is a mobile web browser 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.
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
-
Install Node.js version 10 (latest stable) and yarn@1 (latest)
- If you are using nvm (recommended) running
nvm use
will automatically choose the right node version for you.
- If you are using nvm (recommended) running
-
Install the shared React Native dependencies (
React Native CLI
, notExpo CLI
) -
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 install # this will run a lengthy postinstall flow
cd ios && pod install && cd .. # install pods for iOS
- Non-MetaMask Only: In the project root folder run
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
MM_INFURA_PROJECT_ID
in.js.env
. (App will run without it, but will not be able to connect to actual network.) -
Then, in one terminal, run:
yarn watch
- Install the Android SDK, via Android Studio.
- MetaMask Only: To create production builds, you need to install Google Play Licensing Library via the SDK Manager in Android Studio.
- Linux only:
- Ensure that you have the
secret-tool
binary on your machine.- Part of the libsecret-tools package on Debian/Ubuntu based distributions.
- Ensure that you have the
- Install the correct emulator
- Follow the instructions at:
- React Native Getting Started - Android (React Native CLI Quickstart -> [your OS] -> Android)
- More details can be found on the Android Developer site
- You should use the following:
- Android OS Version: Latest, unless told otherwise
- Device: Google Pixel 3
- Follow the instructions at:
- Finally, start the emulator from Android Studio, and run:
yarn start:android
- Install the iOS dependencies
- React Native Getting Started - iOS (React Native CLI Quickstart -> [your OS] -> iOS)
- You do not need CocoaPods
- React Native Getting Started - iOS (React Native CLI Quickstart -> [your OS] -> iOS)
- Install the correct simulator
- iOS OS Version: Latest, unless told otherwise
- Device: iPhone 11 Pro
yarn start:ios
Unfortunately, the build system may fail to pick up local changes, such as installing new NPM packages or yarn link
ing 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
If yarn link
fails after going through these steps, try directly yarn add
ing the local files instead.
First, make sure you have the following running:
yarn watch
- Your Android emulator or iOS simulator
yarn start:android
oryarn start:ios
Next, check that the React Native Debugger is working:
- Open your emulator or simulator, and select
Debug JS Remotely
(or something similar) from its developer menu - To open the developer menu:
- iOS Simulator:
Cmd + D
- Android Emulator
- macOS:
Cmd + M
- Windows, Linux:
Ctrl + M
- macOS:
- iOS Simulator:
- If it doesn't open automatically, try navigating to this URL in Chrome: http://localhost:8081/debugger-ui/
- If these steps do not take you to the React Native Debugger, something is wrong
For more details, see this page.
- You should be able to inspect the mobile app using the console in the React Native Debugger in Chrome
- To debug a website (dapp) in the browser:
- Navigate to the website in the app's browser
- Open Safari
- Go to: Preferences -> Advanced and select
Show Develop menu in menu bar
- Go to: Preferences -> Advanced and select
- Select
Develop
in the menu bar- Find your simulator in the second section from the top
- Select the relevant WebView from the list
- The simulator will highlight the WebView when you hover over it in Safari
For more details, see this page.
- You should be able to inspect the mobile app using the console in the React Native Debugger in Chrome
- To debug a website (dapp) in the browser:
- Navigate to the website in the app's browser
- Go to chrome://inspect
- Select the relevant WebView under Remote Target
yarn test:unit
First, follow the instructions here to install applesimutils
. Then:
yarn test:e2e:ios
yarn test:e2e:android
To get a better understanding of the internal architecture of this app take a look at this diagram.
MetaMask Mobile is an exciting development for our team and our ecosystem. We've always been proud to offer the MetaMask browser extension under the MIT open source software license. We are still working through licensing considerations for the mobile application in light of a new delivery medium and our business goals. We are exploring many models, all with a significant open component, but we have not made any final decisions.
The source code for this beta is currently viewable under the below copyright. A license to use the mobile version will be distributed along with the mobile application. We believe it is important for our users to be able inspect and verify our code for trustworthiness, but we also wish to preserve our licensing options until we're certain what is best for MetaMask, our community, and our ecosystem. If you have any questions or comments, we would really appreciate hearing your feedback – you can reach us at [email protected]
© ConsenSys AG, 2016-2019
You are granted a limited non-exclusive license to inspect and study the code in this repository. There is no associated right to reproduction granted under this license except where reproduction is necessary for inspection and study of the code. You may not otherwise reproduce, distribute, modify or create derivative works of the code without our prior consent. All other rights are expressly reserved.