I want my UWP app to be really Universal. I mean, it should work as normal Windows app, but also with command line interface.
I know I can
(1) make execution alias, and access command line parameters:
https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.activation.commandlineactivatedeventargs
(2) make command line app: https://learn.microsoft.com/en-us/windows/uwp/launch-resume/console-uwp
To add some command line support, I used method (1).
But I cannot (or, I don't know how) write to console from such app. I can only read command line arguments (and, e.g., send Bluetooth packet to my bulb to change color).
There is also (2), so I added RemoteSystem support for my main app, and make small console app to send commands from command line via RemoteSystem to my main app, and use Console.WriteLine to print output received from my main app via RemoteSystem.
But it seems that console app cannot use RemoteSystem (oAppSrvConn.OpenAsync() exception - but same code used in another UWP app works ok).
So, is there any possibility to have universal app written in UWP? I mean, same app for command line in/out, and for Windows UI?
Or, maybe, last implementation of idea of universal app was IBM OS/360? :)