ios可以生成一个静态的离线bundle,android的刚出来实在没找到文档
React native android如何在真机上部署,不用连dev server?
shipengyan88
#2
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
然在build release
mac上支持拷贝的好像,windows就掺了
linuxqueen
#4
这样弄确实是可以的,我搜到的也是这个方案:
http ://stackoverflow.com/questions/32572399/react-native-android-failed-to-load-js-bundle
(游客不能贴链接,这是啥规定啊。。。http后面加了一个空格,自己去掉就是)
下载下来的bundle文件放到assets目录下,重新运行一下react-native run-android就会生成新的apk了。
看最后的一个回复,貌似是官方的某人,说是先凑活这么用,下一个版本会优化:
With the next release (0.12) we’ll fix react-native bundle command to work with android projects as expected.
android刚出来,好多坑啊