node.js
(>=10
)yarn
(tested on1.6.0
)- rustup https://rustup.rs/
- watchman install instructions also you may need to increase the number of inotify watches with
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf;
sudo sysctl -p;
- if node was installed with nvm you may need to run
sudo ln -s "$(which node)" /usr/local/bin/node
cocoapods
($ sudo gem install cocoapods
)Xcode
(tested onVersion 11.3.1 (9F2000)
)
- Install Android Studio (only for Android, tested on
Version 4.1
), e.g like here - In Android studio, let the sdk point to
~/Android/Sdk/
- Example of what sdk and tools to install
- On linux make sure you have installed
build-essential
- Set environment variable for
$JAVA_HOME
set to java home directory,$ANDROID_HOME
set to Android SDK directory and$NDK_HOME
to point to the ndk directory and version installed by Android Studio.
example of ~/.bashrc
or ~/.zhrc
:
# React native Android development
export ANDROID_HOME=$HOME/Android/Sdk
export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
export NDK_HOME=$ANDROID_HOME/ndk/22.0.7026061
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$JAVA_HOME/bin
- run
./scripts/init.sh
to install rust dependancies
-
Install Dependencies
yarn install:ios
-
Install Dependencies
yarn install
-
Generate an Android Debug Key if it is first time.
./scripts/gen_key.sh
-
Start React Native server
yarn start
Then:
-
iOS
yarn ios
-
Android
yarn android
Magic command to clean, reinstall deps and launch the RN server with the cache cleaned:
yarn clean:android && yarn && yarn start --reset-cache
Visite the right network and go to the js console e.g: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/js Type:
console.log(api.runtimeMetadata.asCallsOnly.toHex())
console.log(api.runtimeVersion.specVersion.toNumber())