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
?
相关问题
- How can I get a window object from new BrowserWind
- Failed at the electron@1.8.2 postinstall script
- No member named ForceSet
- Export HTMLtable to CSV in electron
- Using electron-usb with electron
相关文章
- Configuring electron-webpack renderer to work with
- Error messages and console logs in Electron?
- Adding Apple in-app purchase to Electron HTML/JS a
- Minimal Example: Opening a window in electron from
- Electron dying without any information, what now?
- Electron without GUI
- Testing Electron application with org.openqa.selen
- How to build the Electron application for the Wind
Parse the parameter by adding sample code below to your electron main.js
It can still be parsed on electron executable app by running in cmd like "electronapp.exe -windows"
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: