Giter VIP home page Giter VIP logo

docker-react-native's Introduction

Disclaimer

This is a fork from gilesp's react_native.

Usage

Get image

Usual clone and image install:

> git clone https://github.com/MaximeD/docker-react-native
> cd docker-react-native

> docker build -t react-native .

Next you will need to have the two scripts available in your path. For example you can edit your .bashrc and add:

export PATH="$HOME/docker-react-native:$PATH"

Create a new react native project

Initialize repository.

> react-native.sh init MyAwesomeProjet

(You can safey ignore errors from npm.)

Connect to container and install missing packages

> cd MyAwesomeProjet
> react-native-container.sh

dev> cd node_modules/react-native/
dev> yarn

Run project

Inside container:

dev> adb reverse tcp:8081 tcp:8081 # you'll need android > 5.1 for this
dev> react-native start > react-start.log 2>&1 &
dev> react-native android
dev> react-native run-android

Hot reload

dev> watchman watch .

To enable it on your phone, shake it, and select Enable Hot Reloading. You will also need to access Dev Settings > Debug server host & port for device and enter localhost:8081.

Install udev rules

On your host system, you'll need to install the android udev rules if you want to connect your phone or tablet via USB and deploy the react native app directly to it. You can get the rules from http://source.android.com/source/51-android.rules and you can install them as follows:

wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules

docker-react-native's People

Contributors

maximed avatar mrceperka avatar fjibj avatar

Stargazers

Ennio avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.