Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Latest commit

 

History

History
99 lines (75 loc) · 2.85 KB

Development.md

File metadata and controls

99 lines (75 loc) · 2.85 KB

Development

Requirements

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

iOS

  • cocoapods ($ sudo gem install cocoapods)
  • Xcode (tested on Version 11.3.1 (9F2000))

Android

  • 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 Selection_009 Selection_010 Selection_011
  • 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

Setup

  • run ./scripts/init.sh to install rust dependancies

iOS

  • Install Dependencies

    yarn install:ios
    

Android

  • Install Dependencies

    yarn install
    

Any system

  • Generate an Android Debug Key if it is first time.

    ./scripts/gen_key.sh
    

Develop

  • 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

Get new metadata and version manually

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())