You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `cleanupService` is used to handle actions that should be executed after CLI's process had exited. This is an internal service, that runs detached childProcess in which it executes CLI's cleanup actions once CLI is dead. As the process is detached, logs from it are not shown anywhere, so the service exposes a way to add log file in which the child process will write its logs.
1494
+
1495
+
### setCleanupLogFile
1496
+
Defines the log file location where the child cleanup process will write its logs.
1497
+
1498
+
> NOTE: You must call this method immediately after requiring NativeScript CLI. In case you call it after the cleanup process had started, it will not use the passed log file.
1499
+
1500
+
* Definition
1501
+
```TypeScript
1502
+
/**
1503
+
* Sets the file in which the cleanup process will write its logs.
1504
+
* This method must be called before starting the cleanup process, i.e. when CLI is initialized.
1505
+
* @param{string}filePath Path to file where the logs will be written. The logs are appended to the passed file.
CLI is designed as command line tool and when it is used as a library, it does not give you access to all of the methods. This is mainly implementation detail. Most of the CLI's code is created to work in command line, not as a library, so before adding method to public API, most probably it will require some modification.
1492
1519
For example the `$options` injected module contains information about all `--` options passed on the terminal. When the CLI is used as a library, the options are not populated. Before adding method to public API, make sure its implementation does not rely on `$options`.
// Do not dispose ios-device-lib, so the process will remain alive and the debug application (NativeScript Inspector or Chrome DevTools) will be able to connect to the socket.
97
98
// In case we dispose ios-device-lib, the socket will be closed and the code will fail when the debug application tries to read/send data to device socket.
98
99
// That's why the `$ tns debug ios --justlaunch` command will not release the terminal.
99
100
// In case we do not set it to false, the dispose will be called once the command finishes its execution, which will prevent the debugging.
0 commit comments