使用Nativescript管理应用程序的Debug和Release版本的最佳实践? [英] Best practices to manage Debug and Release versions of an application using Nativescript?

查看:76
本文介绍了使用Nativescript管理应用程序的Debug和Release版本的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Nativescript应用程序,该应用程序会为各种服务进行大量服务器调用.这些调用的测试和生产URL有所不同,在Debug和Release版本之间来回切换时,我可能会遗漏或弄乱某些东西(意外地将生产URL用于调试应用程序).我想知道有关App发布的这方面是否有最佳实践?我在互联网上找不到关于我的问题的任何具体答案,而我找到的最接近的东西是这些关于ReactNative应用程序的文章:

I am developing a Nativescript application which makes numerous server calls for various services. The test and production URLs for these calls are different and while switching back and forth between the Debug and Release version I might miss or mess something up (by accidentally using a production URL for debug app). I wanted to know if there are any best practices regarding this aspect of App publishing? I couldn't find any specific answer regarding my question on the internet and the closest thing I found were these article for ReactNative apps:

http://www. multunus.com/blog/2016/06/automated-environment-management-react-native-ios/

http: //blog.carbonfive.com/2016/09/29/setting-up-react-native-build-environments-using-nativemodules/

如果有人可以针对我的Nativescript应用程序指导我,我将不胜感激. 谢谢.

If someone can guide me on this specific to Nativescript application, I would really appreciate it. Thanks.

推荐答案

您可以尝试使用此

You can try use this https://www.npmjs.com/package/nativescript-hook-debug-production when you are trying to debug build it will do filename.debug.extension or when production then from filename.production.extension to filename.extension so inside code, you can require or link to filename.extension

这篇关于使用Nativescript管理应用程序的Debug和Release版本的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆