The following tools are used for debugging the MetaMask mobile app:
- Flipper - For general debugging on iOS and Android
- Redux Debugger - A plugin in Flipper for debugging Redux
- Safari Browser - For debugging the in-app browser for the mobile app
- Google Chrome - For debugging the in-app browser for the mobile app
The prerequisite for debugging is to ensure that the mobile app is up and running:
yarn watch
- Start the metro bundler, which serves the JS bundle to the native appyarn start:android
oryarn start:ios
, which builds the app and installs it in the simulator
Run Flipper using yarn start:flipper
(verified working with v0.263.0)
-
May be prompted to install Flipper for first time users
-
Flipper app runs in the web browser
-
If there are warnings on the
Troubleshoot
tab, follow theSetup Doctor
to resolve all of the checks
Finally, check that the debugger is working:
- With the Flipper browser tab open, open your simulator alongside the Flipper app
- Flipper will auto-detect the device and the application to debug
- At this point, you should now be able to access features such as
Logs
To enable Redux debugging: in Flipper, select the More
tab -> Plugin
and add redux-debugger
- If the plugin is disabled, add or enable the plugin
- Once enabled, the plugin automatically picks up Redux actions, which can be used for debugging state changes
- Run the app in debug mode (for example, in a simulator)
- Open Chrome on your desktop
- Go to
chrome://inspect/#devices
- Look for the device and click inspect
- Run the app in debug mode (for example, in a simulator)
- Make sure the value of
webviewDebuggingEnabled
prop on the Webview component istrue
- Open Safari on your desktop
- Go to the menu Develop -> [Your device] -> [Website]
- Flipper can't find watchman
- Flipper expects watchman in the
user/local/bin
dir - Ex. If
watchman
was installed usingbrew
, you may symlinkln -s /opt/homebrew/bin/watchman /usr/local/bin/watchman
- Flipper expects watchman in the
- IDB binary not found
- Flipper expects
idb
binary to exist in the path provided to it - First, ensure that
idb
is installed - Then update the
idb
binary path in Flipper with the path returned bywhich idb
- Flipper expects
- Trouble installing
idb
withpip3.6
- An alternative is to use
pipx
to installidb
- Ensure that
pipx
path is added to your terminal's profile file usingpipx ensurepath
- An alternative is to use
Flipper
not detecting open simulator whenFlipper
is started- Try both refreshing the web page and the simulator
- Simulators not found and/or an error appearing under simulators showing command failed for
idb list-targets --json
- This is an open issue regarding M1 devices experiencing this issue
- Try creating a symlink for
idb_companion
withsudo ln -s /opt/homebrew/bin/idb_companion /usr/local/bin