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).
- Init the docker
docker run --rm -ti --net host -v /dev/bus/usb:/dev/bus/usb -v $(pwd):/app reactnativecommunity/react-native-android bash
- 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
- Init a default react-native project
cd /app && npx react-native init helloworld
- Run the project
cd helloworld && npx react-native run-android
npm start
On the smartphone, close the app and reopen it.
That's all you should have your newly created app launched!
Top comments (0)