DEV Community

Merlier
Merlier

Posted on • Edited on

1 3

Try react-native with docker in 5 cmd-lines

Warning : the following method is just a way to test quickly react-native. It's not a good practice to every day work.

Requirements:

  • docker >= 19 (the following cmd-lines are designed for linux platform).
  1. Init the docker
docker run --rm -ti --net host -v /dev/bus/usb:/dev/bus/usb -v $(pwd):/app reactnativecommunity/react-native-android bash 
Enter fullscreen mode Exit fullscreen mode
  1. Check device connection

You need to plug an android smartphone in developer mode. Then check if the device is connected and authorized. If not don't forget to press the authorized button on your smartphone.

adb devices
Enter fullscreen mode Exit fullscreen mode
  1. Init a default react-native project
cd /app && npx react-native init helloworld 
Enter fullscreen mode Exit fullscreen mode
  1. Run the project
cd helloworld && npx react-native run-android
Enter fullscreen mode Exit fullscreen mode
npm start
Enter fullscreen mode Exit fullscreen mode

On the smartphone, close the app and reopen it.

That's all you should have your newly created app launched!

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay