How do I execute my code through the terminal while using Xcode? - xcode

I recently started using Xcode and I have been wondering how I could run everything on my terminal instead of using the bottom right corner of my IDE. Could someone explain this to me in baby steps.

Click on project name and click Edit scheme as below,
Click Run and click Options and choose Use Terminal below

Related

Select the target application does not appear in vscode

I use vscode a lot to write scripts for Adobe applications, and in recent days when I opened vscode, the button with the yellow inscription "Select the target application" that appears in the status bar at the bottom of the vscode window suddenly disappeared, and in its place another button appeared with the inscription "Eval in Adobe".
I tried to Google it, I tried to check in the plugin settings if there is a setting that causes this, and also I tried to install previous versions of the plugin, but to no avail.
Please enlighten my eyes and explain to me how to get it back.
I'm not sure if there is a way to get it back, but it should give you the same functionality as before.
The new 'Eval in Adobe' button, after clicking, should give a dropdown of all possible Adobe Apps that you can run your program in.
Alternatively you can go into the Debug panel and click 'Run and Debug'. Then select 'Extendscript' then 'Attach'. At that point it will give you the same Adobe App selection choice.
The button will change to orange and say 'Eval in Adobe (Program Name Here)'. You can then use it to immediately enter debug without having to reselect your target application.

How to define or support a code language on Visual Studio

I just got Visual Studio, and every time I try running the code, a message pops up and says "code language not supported or defined. This happens with any language I try to use. How do I fix it?
In the bottom right corner of the window notice where it says "plain text", Click this and you should see all the available language options. It's probably set to autodetect right now.
STEPS to follow:
1) Install the "CODE RUNNER" extension in Visual Studio (VS) (if you have not done so, yet).
2) After that, go to VS "Settings" (by clicking the wheel) and, in the search field on the top, enter: "run code".
3) You'll see, to the right, all the options available for "Code Runner" settings. Scroll down, and you'll see a field that says,
Code-runner: Executor Map By File Extension.
Set the executor of each file extension.
4) Click on: "Edit in Settings.json".
5) Then, scroll down until you see "code-runner.executorMapByFileExtension" field brackets. You'll be able to see all the files extensions (e.g., ".vb", ".scala", etc.) and the corresponding executor application that run such files after the colons, to the right.
6) If you don't see the extension for the file you're trying to run (e.g., ".js"), just enter it following the same (json) format as the ones above, with the executor program (that you need to know) that runs it, to the right.
EXAMPLE: in the Mac, for a javascript (JS) file with extension ".js" (assuming you've already installed NODE, the JS executor app), you should enter a line at the end (inside the last bracket) such as,
".js": "node"
(NOTE: make sure you put a coma (,) at the end of the previous line, right before your addition)
7) SAVE your edit, and run your program by clicking the arrow on the top right corner of Visual Studio window. Your program output will be shown on the OUTPUT tab in the section below.
Here is a solution:
Close your folder from the Explorer and reopen and run your file. It solves the issue
You saw that error message in vscode because you probably used the shortcut Alt+Ctrl+N to run the code while the output terminal is selected instead of the script. try click the mouse in the script area and do it again, it should work. if the run the code by pressing the button on the top right corner and you still see the same error msg that means you need to check .Jason settings.
Read the language support page for MS Visual Studio: https://code.visualstudio.com/docs/languages/overview
You can define a languages in the files.associations setting.
If you haven't setup language support:
https://code.visualstudio.com/docs/setup/setup-overview
Option 1:
In the right bottom of the window notice where it says "plain text", Click this and you should see all the available options. It probably provides the available list of language .
Option 2: Uninstall the current version and install stable version of visual studio code
On my case, I follow first option at first but I could able to solve the problem so I uninstall the visual studio code and solving the problem using stable version. Try once I may work on your case

Have Xcode show breakpoint in Assistant editor if file is open

So I just got into TDD and working with tests I started using the Assistant editor a lot more. I usually keep my test file on the left and production code on the right. However, when running a test, if I hit an exception or a breakpoint in my production code, the file opens up on the right again, even though it is already open on the left.
My goal is to have Xcode focus on the exception/breakpoint in the Assistant editor if the relevant file is open right now. Is there any way to achieve such behaviour?
The closest thing I found was in the Behaviour tab in preferences where I can choose which editor jumps to the exception/breakpoint, but this should depend on which file did it occur in. So if there is a problem in currently open test file, show it on the left. If it is in currently open production file, show it on the right. If it is in a file that is not showing, then show it wherever.
Thanks

Xcode doesn't open a project normally

I'm using Xcode 4.1 and it has always worked perfectly but today something wrong has happened. Instead of opening my project as it usually does it opens just code editor and nothing else. I have restarted my computer but it doesn't help. Other projects are opened normally. Can you give me a hint about what's going on and what should i do to fix it?
View --> Show Toolbar ,
View --> Show Assistant Editor ,
View --> Show Project navigator
and so on.
The solution, as others wrote before, is to reopen the missing panes and toolbar via the menu.
The cause of the problem is simple: If you open a source file in its own window (by double clicking it in the navigator or so) it just shows the editor pane. if you then close the main project window and the single source window afterwards, Xcode saves that last window state as the current view configuration in the project.
The intermediate solution is to never close the project window before closing all other source windows. But Apple should really fix this stupid bug. It has been around for too long.
Go to
View --> Show Toolbar.
I've had this before, don't know how it happened, but this fixed it.

In Xcode is there code that will open up the console for you?

Is there a way in Xcode to have your software open up the console for you? I would like to have it when my code compiles and runs in Debug to have the console open up automatically but in release for it to not open.
Thanks in advance.
A common way to achieve this is :
Open a new tab, and rename it 'Console' (or what name you want)
In this tab, show only the panes you want (in your case the console)
Go to Preferences>Behaviors
Tell Xcode to 'Show tab' and give it the name you set in 1. (you can set this at various moments, when build starts, or when app runs).
Now, each you will either compile or run your app, Xcode will switch to the tab you have set in Prefs.
You dont use code, you go to xcode pref's and do it there
This is where I came for the answer given and marked correct (although it's not clear it was what the asker quite wanted).
Arguably, a simpler version of the answer given is to set the Behaviors preferences to show the Debugger when a run starts. With the settings in the image below, this opens up the console (or the console + variable views or the variables view, depending on how it was last set - that's what 'Current Views' means).

Resources