开发人员模式下用于Windows的电子生成器程序包 [英] electron-builder package for windows in dev mode

查看:148
本文介绍了开发人员模式下用于Windows的电子生成器程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Windows上测试我的应用程序,但我使用的是Mac。将应用程序打包为在Windows上运行非常容易,但是我无法以开发人员模式打包该应用程序。我正在使用electronic-is-dev来确定我是否在dev中运行。我需要在Windows上运行测试,因为我正在测试非常特定的Windows硬件功能。我不想评论我的 if(isDev){doSomething} 只是为了运行这些测试,然后取消注释,然后再进行更改。我希望可以在电子构建cli中设置一些标志,或者运行 electon。 -windows

I need to test my app on windows, but I am using a mac. It is very easy to package the app to run on windows, but I cannot package the app in dev-mode. I am using electron-is-dev to decide if I am running in dev or not. I need to run my tests on windows because I am testing a very specific windows hardware functionality. I don't want to comment my if(isDev){doSomething} just to run these test, and then uncomment it before I push the change. I was hoping there is some flag I can set in the electron-build cli, or maybe run electon . -windows?

推荐答案

使用IsDev的最佳方法是添加应用程序的ELECTRON_IS_DEV环境变量有点像@carlokid建议。我使用了: https://stackoverflow.com/a/34769146/3966009 。这是我用于应用程序的目标:

The best way to do this so as to use the IsDev is to add the ELECTRON_IS_DEV environment variable to the app kinda like @carlokid suggested. I used: https://stackoverflow.com/a/34769146/3966009. This is the target I used for my app:

C:\Windows\System32\cmd.exe /c "SET ELECTRON_IS_DEV=1 && START ^"^" ^"C:\Program Files (x86)\My App\Fun Time.exe^""

这篇关于开发人员模式下用于Windows的电子生成器程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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