MetaMask Only: To create production builds, you need to install Google Play Licensing Library via the SDK Manager in Android Studio.
Install the Android NDK, via Android Studio's SDK Manager.
In the SDK Manager, select the SDK Tools tab and install NDK version 21.4.7075529. You'll need to click "Show Package Details" in order to select the appropriate version.
Linux only:
Ensure that you have the secret-tool binary on your machine.
Part of the libsecret-tools package on Debian/Ubuntu based distributions.
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.
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.)
Install the app:
yarn setup # not the usual install command, this will run a lengthy postinstall flow
cd ios && pod install && cd .. # install pods for iOS
Then, in one terminal, run:
yarn watch
Android
yarn start:android
iOS
yarn start:ios
Build Troubleshooting
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
If yarn link fails after going through these steps, try directly yarn adding the local files instead.
Debugging
First, make sure you have the following running:
yarn watch
Your Android emulator or iOS simulator
yarn start:android or yarn start:ios
Next, install the Flipper desktop app (verified working with v0.127.0)
Once Flipper is installed, configure your system as follows:
Whenever you change dependencies (adding, removing, or updating, either in package.json or yarn.lock), there are various files that must be kept up-to-date.
yarn.lock:
Run yarn setup again after your changes to ensure yarn.lock has been properly updated.
The allow-scripts configuration in package.json
Run yarn allow-scripts auto to update the allow-scripts configuration 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.
Unfortunately, yarn allow-scripts auto will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies.
Architecture
To get a better understanding of the internal architecture of this app take a look at this diagram.
Storybook
We have begun documenting our components using storybook please read the Documentation Guidelines to get up and running.
请发表评论