I have a console-based server and client application which talk to each other over a TCP socket on localhost (although eventually will be used on separate machines).
I see that if I manually launch the server target and then the client, XCode seems happy enough to run them both in separate debugger contexts, they connect and work just fine.
Ideally I'd like to set it up (via a scheme or pre-run step or something) such that I can one-click 'run' (or cmd-R) and both these contexts pop up and run happily.
So far my experiments with the post-run script (for the server) passing "$(BUILT_PRODUCTS_DIR)/cclient" to /bin/sh seems not to work, and this is less than ideal anyway because it wouldn't run in a debugger context anyway.
Is there a way i can easily set this up?
Thanks,
DaveM
EDIT: Added a screenshot of what I can achieve with several clicks, but would like to get to with one click/key-combo...
You can set up scripts and other actions in breakpoints.
Click on the left side of editor to create a breakpoint, and CMD+OPT+click on the breakpoint icon to edit its options.
Also, you can choose the 'Automatically continue after evaluation' option, for convenience.
For details, see Session 412 Debugging in Xcode from WWDC 2012 videos. This session just happened to demo debugging skills with Xcode in a client-server setting.
Related
I have a small warp server project on Windows that listen to a particular port and do something whenever I send a command to it by REST (for example: POST http://10.10.10.1:5000/print). It's a small client for printing PDF / receipt directly from another computer.
It works. But my problem is when I had to package the whole project, the Rust compiler give me an executable file (.exe). The application displays a terminal window when I run it. I want this terminal to be hidden somehow.
I try to run the program as a windows service (by using NSSM). It doesn't work for me since I had to access the printer. Windows doesn't allow my app to access any devices or any other executable as a windows service. (The reasons are explained here: How can I run an EXE program from a Windows Service using C#?)
So I plan to run my app as a tray-icon application so user can control or close the app. (https://github.com/olback/tray-item-rs)
Unfortunately, I still cannot hide the app's terminal window.
Another solution that I found is hstart (https://www.ntwind.com/software/hstart.html). But I would like to use this as "the last resort" solution since many antivirus/windows defender mark it as a malware.
Do anyone know how to hide or get rid of it ?
After lot of searching, It turns out to be easier than I thought. Just add
#![windows_subsystem = "windows"]
on top of your main.rs file. (for rust > 1.18) and the terminal is gone.
These control the /SUBSYSTEM flag in the linker. For now, only
"console" and "windows" are supported.
When is this useful? In the simplest terms, if you're developing a
graphical application, and do not specify "windows", a console window
would flash up upon your application's start. With this flag, it
won't.
https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute
https://blog.rust-lang.org/2017/06/08/Rust-1.18.html
https://learn.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem?view=msvc-170
I worked on a Console Application with a friend today. Is it possible to share the default console during a Live Share session? What I mean is that we had to compile and run our program manually through the default Windows Terminal to see output(which wasn't the best idea, there was a ton of empty lines displayed every time we would input anything), and debugging was impossible because we just couldn't see the console (only the host could).
According to the docs, it's possible to share the terminal in both VS Code and Visual Studio, but I don't think there's a way to share the console that comes up when you debug a console app. The solution I see is simply sharing a terminal, running your app in it manually and if you want debugging, you can try attaching the VS debugger to the console app's process after you start it manually by following this guide.
Many applications start at startup, however, some of them do not appear on the task manager startup tab. What is that due to?
Is there any way to do this with a program, for example, spotify?
What do I need to do in order for a program to start at startup, but not showing in the startup applications tab?
Setting it in HKCU/Microsoft/Windows/CurrentVersion/Run doesn't seem to work, as it starts, but still shows on the mentioned tab.
Thank you in advance.
Its mostly a factor of how the program itself is written. If its written to run as a service, or as a System Tray application, or otherwise.
I know there are wrappers for running any exe as a service NSSM being the main one I have experience with (but this is mostly for when there is going to be NO user interaction)
I do not know if there is anything that can allow an application to run in the system tray only, not in the taskbar, if it doesn't support it.
But since Spotify does support running minimized to the tray, it does seem like there are some ways to "start spotify minimized", Spotify or other applications might have command line options or other settings to tell them to start "hidden"
I have a web application that uses IIS, but when I try to debug it VS just locks up and gives me the hour glass cursor icon. No browser window opens, nor does an instance pop up in the Task Manager. VS says its Running / not "Not Responding", but I cannot interact with the IDE. Can't Ctrl-Break to stop or anything.
I was able to run it before, and I'm not aware of any system or IIS changes that could cause this. I've disabled source control and I've tried launching the app in both Chrome and IE but it still behaves the exact same way as described above.
Has anyone else encountered this? The only threads I could find just describe general slowness in the IDE but otherwise its functional. The recommended fix was to disable the source control functionality, which as I said I already tried.
I should note that I don't seem to have an issue running & debugging winforms applications. I also just created a web application and was able to launch it in Chrome and get to the homepage. Also, it doesn't make a difference if I have a breakpoint set or not.
This solution has 4 different projects. If I set a different project as the Startup Project, it does run and launches the browser but it just gives me a 'file explorer' sort of view where it just lists the files in that project's directly which is obviously not what I want.
Edit; If I manually open a browser tab, try to navigate to http://localhost/myApplication, VS pops up and asks if I want to attach process w3wp.exe to IIS APPPOOL\myAppPool. If I attach, it opens a new tab in Chrome and my application runs. But unless I do these 2 steps, it does not run.
I love firebug for helping debug my web apps, as well as seeing how others have implemented there sites. However firebug hinders memory leak testing.
I've just found that FireFox can be launched in safemode which disables all addons, which is great for memory usage testing however once firefix is launched (either samemode or not) all subsequent firefox launches (they all appear in task manager as 1 firefox instance) will use the mode of the first one.
I'd like to leave one in same mode testing some apps for leaks and use another with firebug to develop.
I've tried making a copy of the FireFix.exe and even copying the whole firefox directory but it still launches as one application.
I could always use VirtualBox to create a full virtual PC for this testing but that seams like a large overhead.
Edit
I have just tried the -no-remote switch but it just comes up with "firefox is already running .... you must first close the existing Firefox process.... "
First close all your Firefox instances. With all instances closed, run firefox via the "Run..." dialog on windows, typing "firefox -p". It will open with the profile manager, where you can create multiple profiles with different configurations.
After creating your profiles, just run you "main" browser using "firefox -p" and select your "main" profile. To open another instance using a different profile, run Firefox using "firefox -no-remote -p" and it will prompt the profile manager again, so you can choose a different profile.