Cordova 在真实设备上实时重新加载Ionic v3

Cordova 在真实设备上实时重新加载Ionic v3,cordova,ionic3,cordova-plugins,livereload,Cordova,Ionic3,Cordova Plugins,Livereload,是否有可能在实际的Android设备上进行实时重新加载。目前运行android-l的爱奥尼亚cordova推出了一个web服务器端口,用于实时重新加载,它在我的设备上,但它将其视为浏览器而不是本机应用程序。因此,像window.plugins和window.cordova这样的项目无法加载到服务器/浏览器的实时重新加载中,这一直让我头疼 我喜欢live reload的快速开发功能,但是没有窗口。插件和窗口。cordova我的应用程序的许多方面都在崩溃-我使用了很多独立插件,而不是ionic na

是否有可能在实际的Android设备上进行实时重新加载。目前运行android-l的爱奥尼亚cordova推出了一个web服务器端口,用于实时重新加载,它在我的设备上,但它将其视为浏览器而不是本机应用程序。因此,像
window.plugins
window.cordova
这样的项目无法加载到服务器/浏览器的实时重新加载中,这一直让我头疼

我喜欢live reload的快速开发功能,但是没有
窗口。插件和
窗口。cordova
我的应用程序的许多方面都在崩溃-我使用了很多独立插件,而不是ionic native


谢谢。

我在另一个论坛上找到了解决方案。基本上,您必须将
cordova.js
文件复制到根项目
/www
文件夹中

3. Make cordova and plugins available
Copy the following from the viewer app’s platforms/ios/platform_www on the mac:
cordova_plugins.js, cordova.js + the two folders cordova-js-src and plugins and paste them into your www folder on the developement machine.

Thats it. Now you can do this ionic serve on your developement machine:
ionic serve -a -b -s -c -l --platform ios --nocordovamock

Then start the viewer app on your mac (or device). It should now load your project and automatically update when you save any changes.

When you are ready to publish your app you have to remove the cordova_plugins.js, cordova.js + the two folders cordova-js-src and plugins in your www folder before the final build.

原始版本中还有一些更详细的信息-用于日志记录和其他用户输入:

您可以尝试@duanx,谢谢。我试过你的推荐。但它也没有加载
窗口.plugins
窗口.cordova
。我的代码在那些非本机插件上仍然出错。到目前为止,我似乎能让我的应用程序中的人明白的唯一方法是加载,即每次手动运行到设备上。关于如何在
实时重新加载
服务-c
中加载这两个项目,还有其他想法吗???