React Native构建官方example学习笔记

慕课网有个基础课程,可以参看

Windows平台

  1. 将官方仓库 clone
    cmd 中:
    git clone https://github.com/facebook/react-native.git
  2. 安卓Git 命令行工具
    之后在克隆下来的根目录下git bash
  3. 设置android sdk
  4. 设置NDK
    要选择正确的版本
    https://developer.android.google.cn/ndk/downloads/index.html
    配置环境变量
    ANDROID_NDK
    PATH中添加上ANDROID_NDK

之后运行 Example

https://github.com/facebook/react-native/tree/master/RNTester

中有介绍
cd react-native
./gradlew :RNTester:android:app:installDebug
启动包管理器
./scripts/packager.sh

另一种方式编译运行
1. 将UIExplorer 中的js 代码copy到自己创建的react -native项目下的js 文件夹
2. 修改app build 文件与例子一致
3. 修改UIExplorerApplication.java 中getJSMainModuleName()返回的路径

这里写图片描述

打开As终端关闭之前的包管理器窗口,进入上一层路径
react-native run-android
即可运行成功

MAC平台

git clone https://github.com/facebook/react-native.git

cd react-native/

以下俩个命令一定要执行
npm config set registry https://registry.npm.taobao.org –global
npm config set disturl https://npm.taobao.org/dist –global

安装这个项目所需要的包
npm install

接下来的操作和上述的Windows一样

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
React Native By Example by Richard Kho English | 24 Apr. 2017 | ASIN: B01M31KB4Q | 414 Pages | AZW3 | 4.46 MB Key Features Work on native APIs and UI Elements using React Native Get the best of both worlds: the power of native approach and the fluidity of JavaScript Create increasingly complex real-world applications and dive deeper into React Native Book Description React Native's ability to build performant mobile applications with JavaScript has resulted in its popularity amongst developers. Developers now have the luxury to create incredible mobile experiences that look and feel native to their platforms with the comfort of a well-known language and the popular React.js library. This book will show you how to build your own native mobile applications for the iOS and Android platforms while leveraging the finesse and simplicity of JavaScript and React. Throughout the book you will build three projects, each of increasing complexity. You will also link up with the third-party Facebook SDK, convert an app to support the Redux architecture, and learn the process involved in making your apps available for sale on the iOS App Store and Google Play. At the end of this book, you will have learned and implemented a wide breadth of core APIs and components found in the React Native framework that are necessary in creating great mobile experiences. What you will learn How to create mobile-performant iOS and Android apps using JavaScript and React The potential of each API and component, putting them into practice throughout the course of three projects The process of integrating the Facebook SDK to build an app that connects to third-party data Every step taken to implement Redux, a popular state management library, in your mobile apps The requirements for building and deploying your apps to market, with detailed instructions on how to release and beta test apps on both the Apple App Store and Google Play About the Author Richard Kho is a software engineer livin
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值