跟我一起使用android Studio打包react-native项目的APK

使用的是react-native的hello-world项目
第一步:创建项目

npm install -g yarn react-native-cli
react-native init AwesomeProject
cd AwesomeProject
//react-native run-android
第二步:打开我们的android studio 记住路径是直接到了android项目 ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190410220830374-1705609641.png) ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190410221226181-1417944179.png) ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190410222300889-1537833486.png)
第二步:导出apk文件 ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190411003605341-1287007091.png) ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190411003615944-1358731810.png) ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190411003624760-1391699173.png) ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190411003651360-1131803325.png) ![](https://img2018.cnblogs.com/blog/1037363/201904/1037363-20190411003640187-402182144.png)

第三步:完成之后运行这个

就可以在我们的测试机中看到应用项目啦

posted @ 2019-04-11 00:35  jser_dimple  阅读(1213)  评论(0编辑  收藏  举报
/*function gotourl() { var url = "https://www.cnblogs.com/smart-girl/"; var localurl = document.url; if( localurl.substring(0,url.length) != url ) { location.href=url; } } gotourl();*/