force TideSDK debug console window to stay open on windows - windows

I'm trying to debug a HTML5/javascript application that uses the TideSDK (1.2.0RC4). I can run the build script and create an executable and start it with <appname>.exe --debug. The executable starts and opens a separate console window with log output, than exits with an error code and closes the console window. I've got no idea what went wrong because I can't see the log output. How do I force the window that contains the log output to stay open? I dimly remembered cmd /k ... but that doesn't work. Anyone any pointers?

Checkout TideSDK 1.3.1-beta available for download at http://tidesdk.org
The earlier version is not supported.

Related

Packaged Electron app (.exe) crashes silently, runs fine via command line

Running my Electron app via command-line works fine, but when I double-click the .exe of the packaged app, nothing happens other than my cursor doing a quick "busy" animation. I assume my app is silently crashing.
Is there a way I can get an error message or a crash report from the .exe to help me see what's going on?
From the root of my app directory, both these methods result in my app running fine:
node_modules\.bin\electron.cmd .
electron-packager .
node_modules\.bin\electron.cmd my_app-win32-x64\resources\app
Environment
OS: Windows 10 Anniversary x64
Node: 4.3.1
Npm: 1.14.12
Local electron: 1.4.3
Local and Global electron-packager: 8.1.0
electron-rebuild (for native module "serialport"): 1.2.1
This was not an Electron problem. This was my app trying to access a path relative to process.cwd(), which, when double-clicking the .exe file in the output folder, was not the expected one.
I was able to debug this by running the .exe from the command line, instead of double-clicking the .exe:
my_app-win32-x64\my_app.exe
This causes console.log() output to be visible in the command prompt, which allowed me to finally see the exception that was occurring.
One way to debug such issues is to open a terminal or cmd and drag the exe to it or launch the exe from the terminal or cmd. this will print any uncaught error the app might be throwing.
This can be an issue with paths if you're spawning sub processes - you can use https://github.com/jonluca/node-fix-path to fix the paths on linux and macos

Mono GUI Runtime How to hide the console window

I have a Mono Winforms project compiled with Xamarin Studio. When I run from XS, it does not show a console windows. However, after I bundle the package on the Mac( using mkbundle and pkgbuild) and then install it, a bash shell is shown when I execute the program. When I exit the program, the shell remains open with a final message "Process completed". I then have to close the shell window.
I would like to be able to execute the application and not show the console window. It would also be acceptable if the shell window would close by itself when the application exits.
I tried and added this tag to my csproj but no good:
WinExe
I saw another post which stated to use a compiler switch to specify the target to be WinExe. However, I do not see anywhere in XS to add custom compiler switches. ( I think the switch was /target:WinExe).
Anyone have any workaround that these have used for this case?
Thanks in advance.
Project options / Build / General / Code Generation / Compile Target
Executable = /target:exe
Library = /target:library
Executable with GUI = /target:winexe
Module = /target:module

running SWF from the command line and getting trace output to the console

On windows 7, I installed Flash Builder 4.7 and got the Flex SDK with it (4.9.1, I think). I'm now compiling .as files on the command line. I'm running the resulting SWF files with FlashPlayerDebugger.exe (that came with my trial of Flash Builder 4.7). I'd like to see trace() output on the cmd.exe window, but I don't know how. If I should be using a different way to run the SWF files (perhaps sending them to a browser?) let me know.
You can use the command line debugger, fdb to see console output.
First, compile a debug SWF:
mxmlc -debug=true myApp.mxml
Then launch the debugger:
java -jar ../lib/fdb.jar
Then you can either launch your app in the standalone Flash Player or in a browser. When you see the (fdb) prompt, use the run debugger command to start your app. You have several choices:
run <path to SWF> (launch SWF in the standalone Flash Player)
run <url to SWF> or run <path to HTML file that embeds SWF> (launch in browser)

How can I automatically run my programs in a Terminal window & debug with Xcode?

I am building a program on Mac OS that uses the curses library. When I attempt to run it inside Xcode, I get this error message:
Error opening terminal: unknown.
And then curses calls exit.
Obviously, it works from a Terminal window.
Is it possible to launch my program in a terminal window from Xcode? I know that I can use the "Wait for XXX to launch" option, but a lot of Xcode's helpfulness in starting programs vanishes that way, so I would be looking for another way.
Xcode uses GDB, or LLDB for debugging.
You can invoke them directly from a terminal. This way, your executable will be attached to a working one.
Try:
gdb path/to/my/executable
Then, from the GDB prompt, type:
run
To start your program in debugging mode.
Take a look at the GDB manual for learning stuff like debugging commands, breakpoints, etc.

How to get the output of an OS X application on the console, or to a file?

I am writing a Cocoa application with Mono embedded. I want to run and see my debug output in Terminal. On the Cocoa side I am using NSLog(), and on the Mono side I am using Debug.Write(). I can see my debug output in Xcode's console, but not in Terminal. This is what I tried:
$: open /path/build/Debug/MyProgram.app
$: open /path/build/Debug/MyProgram.app > output
$: open /path/build/Debug/MyProgram.app 2> output
in a terminal but I do not my output on the console or in 'ouput'.
What's the correct command?
PS. My ultimate goal is to write a vim plugin to manage, build, run, debug the xcode project. You can save me this hassle if you can get this vi input manager to work with xcode.
Chris gave a good overview of how the Console works, but to specifically answer your question: If you want to see the results directly in your Terminal, you need to run the built product as a child of the Terminal, which means using something like
/path/debug/build/MyProgram.app/Contents/MacOS/MyProgram
to launch the app.
Terminal on Mac OS X is just another application. Opening a terminal window for text I/O is not an inherent capability of every application as it is on Windows.
Furthermore, open /path/to/MyApp.app does not execute MyApp.app as a subprocess of your shell, it sends a message to the operating system's launch infrastructure asking it to execute the application in a normal fashion, the same as if it were double-clicked in the Finder or clicked in the Dock. That's why you're not able to just redirect its output to see what your app is sending to stdout or stderr.
You can use Console.app to see the output of applications launched in the normal manner, because the launch infrastructure specifically sends their stdout and stderr there. You can also use the asl routines to query the log, or perform more sophisticated logging if you so desire.
Open Console.app in /Applications/Utilities. All NSLog output will be printed in the System log.
Or, if you run it from within Xcode, all of the output will be printed in the Debug console.
I'm not on my Mac right now and don't recall the command sequence or the menu the Debug Console is in, possibly the Build menu?
Overview
The idea is to simply run the app from command line using ios-deploy.
Instructions
Install ios-deploy
Run the app from xcode (make sure it runs successfully)
go to xcode menu > preferences > locations and click on arrow in derived data:
in the derived data directory, search for your .app file under Build/intermediates/Products
in the terminal type the following
ios-deploy --debug --bundle
then drag the .app file from step 4 unto the terminal.. you should have something like this
ios-deploy --debug --bundle path/to/your/applicationName.app
and that's it! The app should successfully run and all the logs will go to your terminal.

Resources