I am building an iphone app.However my app crashes at a point when i run simulator.I want to know the reason.But i don't know how to see crash logs. Please give me some information about how to see crash logs.
in Xcode open the console Window and you will see the crash log.
Use this shortcut to view the console window if it's not already showing:
Debug Area show/hide : ⇧ ⌘ Y
Press the middle button of the view group buttons. It will bring the console and you will see if something happens.
Related
I start each of three iPad's running my app in each one's own Xcode window, each showing the debug log (NSLog) output for each iPad. So there are three windows showing three iPad's running my app.
When iPad #1 crashes, after a few minutes, my app view disappears and iPad home is shown.
But on Xcode, the window that was showing iPad #1 debug log switches to the debug log of one of the remaining iPad's that are still running.
How can I view the debug NSLog logs for iPad #1 again, so I can see what it was doing when it crashed?
Yes, that was it:
cmd-7
or
View menu > Navigators > Show Log Navigator
then find "Debug" row in the pane on the left, and DOUBLE-CLICK its little right-arrow icon on its left.
I was confused because I single-clicked and it updated the title of the tab of the window to the right but didn't update it. Double-clicking opens a new window with the desired log.
Thanks!
After upgrading to xcode 4.2.1 on lion, I tried to do NSLog(#"testing..."); but it's not displayed in the console window (debug area), why ?
p.s. I chose this option from console: All .. which is supposed to mean to display all messages...
the right panel of the debug area was hidden to the right direction.
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".
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.
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.