[英]React native on android studio
How do I configure react native on android studio? 如何在Android Studio上配置本机反应?
I want to synthesize react native on my android studio.How I will do it ? 我想在我的android studio上合成本机反应。我将如何做?
Firstly, install node on your machine. 首先,在计算机上安装节点。 you can download the latest node js ( https://nodejs.org/en/download/ ) and install it. 您可以下载并安装最新的节点js( https://nodejs.org/en/download/ )。
Please confirm node and npm installation using below commands 请使用以下命令确认节点和npm安装
node -v 节点-v
npm -v npm -v
Now, you can install react native by using following command in terminal : 现在,您可以在终端中使用以下命令来安装react native:
npm install -g react-native-cli npm install -g react-native-cli
We can run react native app in an emulator to test it. 我们可以在模拟器中运行react native应用进行测试。 For this we have to setup ANDROID_HOME environment variable ( Computer → Advanced System Settings → Environment variables → New, then enter the path to your Android SDK ) . 为此,我们必须设置ANDROID_HOME环境变量(计算机→高级系统设置→环境变量→新建,然后输入Android SDK的路径)。
Create your first project using below command from the folder where you want to create the app. 在要创建应用的文件夹中,使用以下命令创建第一个项目。
react-native init demoReactApp 反应本地初始化demoReactApp
run the command to start package, make sure you started the emulator. 运行命令以启动程序包,请确保您已启动模拟器。
react-native start 反应性开始
The demo project will be open in the emulator. 该演示项目将在模拟器中打开。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.