iphone -- XCode 4 jumps to main at simulator stop - iphone

when I press stop on the simulator in XCode 4, XCode jumps to the main.m file. Anyone know how to turn this off?

Go to Preferences -> Behaviors. Choose "Run Completes" in the left hand side. Check the box next to "Show Tab" and enter a tab name. I use "Edit".
This way whenever you stop, you will always be back at a tab called Edit.

Related

I hide commandCenter, how can I reopen them

I set window.commandCenter: true, but I accidentally hide launch Command Center Go Back Go Forward.
Now when I right-click the title bar, there is nothing about them.
It used to be like this
old-img
But now it's this, I cann't open that three
now-img
I try reset window.commandCenter: true but nothing happened
You can try resetting all menus with the command:
View: Reset All Menus
When I do that it successfully brings back the Command Center and Go Forward/Back buttons but it puts them off-center which a reload fixes.
If you have hidden any other buttons/icons in the UI those will be reset too of course.
you need to go to below, if you are on Windows OS
File -> Preferences -> Settings, search for "command center" and select the CommandCenter option.
if you are on Mac OS,
Code -> Preferences -> Settings, search for "command center" and select the CommandCenter option

Where are the Organizer and Breakpoints buttons in the workspace toolbar of XCode 5?

I used to use very often the Organzier and Breakpoints button in the toolbar of XCode. The first simple opens the organizer with one click the second switches off or on all breakpoints in the project. But in XCode 5 I can not find these buttons. The help of XCode 5 still talks about these buttons but they are neither on the screenshot in the same documents neither in XCode. Somebody knows how to bring these buttons back?
the Organizer button is removed from XCode 5. And for Breakpoints button, have a look at this image: Have a look
There are no icons that show in the toolbar for Organizer and break points:
cmd + y to enable breakpoints, and
cmd + shift + 2 for Organizer
Finally found it! You can get to the documentation window from the Help Menu.

Shut down iPhone in simulator

This might seem like a strange question, but can I actually shut down the iPhone and restart it in the iPhone simulator? I want to do this to see if my settings are saved and reloaded when the app is relaunched AFTER shutdown.
Thanks
Yes. Press Command+Q to quit the simulator.
This will close all the apps running in the simulator.
Pressing the home button only returns to the home screen without quitting the apps(ios 4 or later) because of multitasking.
You can also double tap the home button, click and hold on the icons at the bottom of the screen till a red circle appear, and click on the red circle to close the running app.
As of XCode 9, the best way to close a single simulator is using the Cmd + W shortcut, or going to File -> Close Window.
If your'e xcode 9.You can now shutdown the simulator by long-pressing the power button.
To close/shutdown one simulated device without closing other simulations, select the device you want to shut down then go to "File" and choose "Close Window".

Xcode 4: How do you view the console?

I can't seem to find a way to have the console run (to show NSLog comments) in XCode 4. The normal method for the previous version of XCode does not work. Does anyone have an idea of how to accomplish this?
You need to click Log Navigator icon (far right in left sidebar). Then choose your Debug/Run session in left sidebar, and you will have console in editor area.
for Xcode 5:
View->Debug Area->Activate Console
shift + cmd + c
If you just want to have the log output display when you run your app then you can go into XCode4 preferences -> Alerts and click on 'Run starts' on the left hand column.
Then select 'Show Debugger' and when you run the app the NSLog output will be displayed below the editor pane.
This way you don't have to select on the 'up arrow' button at the bottom bar.
The console is no extra window anymore but it is under the texteditor area. You can set the preferences to always show this area. Go to "General" "Run Start" and activate "Show Debugger". Under "Run completes" the Debugger is set to hide again. You should deactivate that option. Now the console will remain visible.
EDIT
In the latest GM Release you can show and hide the console via a button in the toolbar. Very easy.
Here' an alternative
In Xcode 4 short cut to display and hide console is (command-shift-Y) , this will show the console and debugger below ur text edior in the same window.
You can always see the console in a different window by opening the Organiser, clicking on the Devices tab, choosing your device and selecting it's console.
Of course, this doesn't work for the simulator :(
There's two options:
Log Navigator (command-7 or view|navigators|log) and select your debug session.
"View | Show Debug Area" to view the NSLog output and interact with the debugger.
Here's a pic with both on. You wouldn't normally have both on, but I can only link one image per post! http://i.stack.imgur.com/4gG4P.png
Here's an alternative.
In XCode4 double-click your Project (Blueprint Icon).
Select the Target (Gray Icon)
Select the Build Phases (Top Center)
Add Build Phase "Run Script" (Green Plus Button, bottom right)
In the textbox below the Shell textfield replace
"Type a script or drag a script file from your workspace" with
"open ${TARGET_BUILD_DIR}/${TARGET_NAME}"
This will open a terminal window with your command-line app running in it.
This is not a great solution because XCode 4 still runs and debugs the app independently of what you're doing in the terminal window that pops up.

What can be causing the problem that I can't make a screenshot from my iPhone app in the Organizer window?

For some reason, when I press "Capture" while my device is connected and running the app (launched via Build & Run in Xcode), nothing happens. Never get a screenshot. iPhone OS 3.0. What can be the problem.
I've had this problem—it seems to be caused by there being a screenshot currently selected in the Organizer. Click on the left-hand screenshot pane to highlight it (i.e. deselect whatever screenshot thumbnail is selected), then hit the Capture button.