Blank screen while packaging electron app on W10 - electron

I build an app with electron on Windows 10 (On mac was working very well).
So when I test the app on W10: cmd "electron ." it's working fine with all the content.
And when i build with "npx electron-packager ." it create the folder with the exe but when I open the exe I have a white blank screen (I have the menu bar but the content of the windows is white/empty)
Many thank for helping

Related

Electron build commands to generate Windows 10 & 11 exe file

i am new to Electron so I went through all the guick start guides, examples and tutorials. I have build a simple Website that i need to convert with Electron and publish as a Windows exe file.
As i am working on MacOS, builds for MacOS are running, all fine.
For Windows i´ve installed mono and wine and found a great tutorial here
When using electron-packager with the following command, it generates an exe which runs only on Windows 10 - but not Windows 11. There is no error message, just nothing opens.
"npx electron-packager . <appname> --platform=darwin,linux,win32 --arch=ia32,x64 --icon=path/to/icons/dir"
When using electron-builder with the following command, it generates an exe which runs only on Windows 11 - but not Windows 10. There is no error message, just nothing opens.
electron-builder -mwl
Can anybody help me out, what´s the right command/parameter to generate one .exe for both platforms? Cannot find a solution on my own after 3-4 hours search, trial & error.
Thanks in advance.

Is the "Loading from metro..." screen only for development, or can I remove it?

I created a new app using `npx react-native init MyApp' which uses the default template. When I run the app both in the simulator and live on my device (iPhone), this happens:
Splash screen shows for a moment
"Loading from metro" screen shows for several seconds - overwriting my splash screen
Main app screen shows
My question is: does this metro screen only show for development and if I publish in the App Store it will not appear? Or is there a way to hide it and go direct from the splash to the main app screen?
The metro screen only shows for debug builds. Make and run a Release build to run the app without the metro screen.
To make a Release build for ios:
To run release build in simulator:
npx react-native run-ios --configuration Release
To run release on phone:
In xcode Product menu > scheme > edit scheme
In sidebar click Run
Select build configuration: Release
Close dialog
Run using Product > Run (same as when testing)
The screen is shown just in the development mode and won't be seen when you debug or release build your application, just try it by
FOR ANDROID
Step 1: Go to the root of the project in the terminal and run the below command:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Step 2: Go to android directory:
cd android
Step 3: Now in this android folder, run this command
./gradlew assembleDebug
There! you’ll find the apk file in the following path:
yourProject/android/app/build/outputs/apk/debug/app-debug.apk
Same goes for IOS too.

Electron does not handle macOS system events

I am developing on macOS.
When running the app on the command line with
npx electron .
If I ues applescript to pass some system events such as "set the window position". The electron app won't handle it.
Note that, if I bundle the app with electron/forge, then the produced applications works fine.

How do I open an Electron app with Cypress

Is there a way to use cypress to open an electron desktop application? I know Cypress can run within an electron browser, but my application is an actual app that is downloaded, installed and run from the desktop.

How to build + run cordova app in 1 step on Mac OS X?

I use Cordova/PhoneGap to create an iOS app. During development, I do changes to HTML/CSS/JS files in www folder and thus have to rebuild regularly. I usually do this on my Mac:
In terminal, I type: cordova prepare
I press CMD + tab to switch to Xcode
I hit CMD + 'R' to run the app on my attached iPhone
This works but it's a little annoying to repeat these steps all the time. Is there a way to speed this up, e.g. by creating a shell script that automagically does all these steps?
Sure, on xcode go to "Build Phases", press the + button and select "New Run Script Phase".
Move it to be over the "Copy www directory"
And use this code:
cordova prepare ios
EDIT:
Is for some reason you can't move the new script over the "Copy www directory" one, I've found another way that will work.
Just open the "Copy www directory" (it's a build script too) and add the cordova prepare ios before the existing code
I found the best solution for me. First, I installed ios-deploy via npm:
$ npm install -g ios-deploy --unsafe-perm=true
Then I simply run this for iOS for example:
$ cordova run ios --device
The run command will internally automatically call prepare and thus copy the content of www and then launch the app on the device.

Resources