2016-01-06 16 views
2

现在,我可以在我的手机上安装react-native示例的调试版本。 请按照下列步骤操作:如何构建react-native的发行版本示例

./gradlew :Examples:UIExplorer:android:app:installDebug 
./packager/packager.sh 

但我不得不开始为应用程序正常运行的服务器。 我想将js-bundle文件捆绑到apk并在我的手机上安装发行版。 我可以向任何地方的朋友展示它。 任何人都可以帮助我吗? 预先感谢您的帮助或提示。

回答

2

首先,你需要签署APK文件,添加一个发布版本类型的gradle的配置下在documentation

的说明,然后,运行您./packager/packager.sh或者干脆npm start包装程序。

下一步是将js包下载到android资产目录。因为没有react.gradle文件,这需要手工完成 - source

curl "http://localhost:8081/Examples/UIExplorer/UIExplorerApp.android.bundle?platform=android&dev=false" -o "Examples/UIExplorer/android/app/src/main/assets/UIExplorerApp.android.bundle" 

最后,你可以运行installRelease gradle这个任务(或assembleRelease,然后手动安装APK)。

0

上pianiel的回答更新:curl命令,现在是

curl "http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=false" -o "Examples/UIExplorer/android/app/src/main/assets/UIExplorerApp.android.bundle" 

因为UIExplorer的项目结构所做的更改。

相关问题