-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use manual mode start? #20
Comments
You have to use I should probably improve the documentation on this. |
aha! I'll give it a go. thanks. It'd be nice to see it in one of the examples at some point. |
I tried that approach and it didn't work. Is it possible you could try it in one of the examples? |
The example was unfortunately out of date. I've updated everything and added some new examples. Take a look at the |
I set
startMode: 'manual'
in mycapacitor.config.ts
I have my built application in
public/nodejs
so it gets copied into the build.I call it like this:
await NodeJS.start({ script: 'dist/index.js', env: { NODE_ENV: 'production' } });
The file s located at
/data/data/com.example.myApp/files/nodejs/public/dist/index.js
(via android device explorer)I added
Logger.info(CapacitorNodeJSPlugin.LOGGER_TAG, "NATIVE START" + Arrays.toString(arguments));
right before the call tonativeStart(arguments, environmentVariables, true);
inNodeProcess.java
and I see:NATIVE START[node, /data/user/0/com.example.myApp/files/nodejs/public/dist/index.js]
so it does seem like it should use that file. However it doesnt seem to actually start my App. Before I go any farther in debugging, is this all I need to do?EDIT: I should say that when i turn off manual mode and switch back to
whenReady()
the app boots as expectedThe text was updated successfully, but these errors were encountered: