Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React Native][Windows] 构建 React Native Android #16

Open
luqin opened this issue Jan 29, 2016 · 1 comment
Open

[React Native][Windows] 构建 React Native Android #16

luqin opened this issue Jan 29, 2016 · 1 comment

Comments

@luqin
Copy link
Owner

luqin commented Jan 29, 2016

本文包含了在 Windows 系统中构建 React Native Android 应用和运行官方示例。

参考:在Windows下搭建React Native Android开发环境

另外需要安装 Android NDK,配置环境变量 ANDROID_NDK,下载地址:http://developer.android.com/ndk/downloads/index.html

模拟器

安装Genymotion,点击 Settings:
image

选择ADB,=>Use custom Android SDK tools,选择SDK的路径:
image

启动一个模拟手机设备,在 DOS 窗口中:adb devices,应该能看到手机设备在运行。

React Native Package Manager

https://github.com/rnpm/rnpm

安卓调试

打开 Chrome,访问 http://localhost:8081/debugger-ui,应当能看到一个页面。按F12打开开发者菜单。

在模拟器或真机菜单中选择Debug JS,即可开始调试。

运行官方 Examples

  • Mac/Linux
./gradlew :Examples:Movies:android:app:installDebug
# Start the packager in a separate shell (make sure you ran npm install):
./packager/packager.sh
# Open the Movies app in your emulator
  • Windows
gradlew :Examples:Movies:android:app:installDebug
:: gradlew :Examples:UIExplorer:android:app:installDebug
:: Start the packager in a separate shell (make sure you ran npm install):
cmd /c call "packager/launchPackager.bat"
:: Open the app in your emulator

生成已签名的APK

@luqin
Copy link
Owner Author

luqin commented May 18, 2016

增加运行官方 Examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant