error from debugger: the program being debugged is not being run - iphone

i have run my application in device but application is crashed and print following message
error from debugger: the program being debugged is not being run.
so please tell me what to do?
my application gonna launch properly but not not debugging first time (gonna crash) than from second time i start application work proper without crashing
my application install in device. we can`t debug in device...

The first thing i do when i get that is a Clean All usually solves that. If you don't see the Clean All button right click your Xcode toolbar, customize, and drag the Clean All button to your toolbar from there.
-Check that the provisioning profile installed on your device haven't expired (would see a red dot in the organizer - Window->Organizer).
-Try restarting XCode.

Do you mean device? If so then it could mean the device is not launching the application correctly. Make sure your developer profile and everything in the build settings is correctly set. This may sound obvious but also make sure the device is unlocked and open.

Related

iPhone Simulator Can't Be Lauched?

When I press Run on Xcode with other tasks already running, the following message appears:
Simulator in Use.
The Simulator can't be launched because it is already in use.
I checked with some friends and when they press run, Xcode automatically stop the tasks running and run the app you want. How can I configure this here?
Thanks in advance,
Quit the simulator and try again. if not working quit the Xcode and try again.
If you have two projects open in Xcode and one is running on the simulator, you can't run the other. Go through each project window and see if any are running, and if they are, press the "Stop" button on the top left:
In most cases Josh answer solves this problem. But just now happened to me to have only one project in Xcode and trying to clean and built it did nothing.
For me (this time) the solution was to:
Right click the simulator from dock and click Quit.
I did the same for Xcode (right click on Xcode in Dock and clicked Quit).
After that just re-open Xcode and voila!
It works!!!
If the issue is you have multiple projects open and running into Simulator conflicts, someone created a little Automator script that closes the current simulator and starts the next one. Kind of a work around but might work for you.
Check out the detailed answer here.
The over attached debugger syndrome
This happens to me when I switch simulator type (ios version or device type) without pressing the stop button (application was still running on it). To fix this, switch back to the old one (if you remember witch it was :P), run then stop the application, switch to the desired simulator configuration, run, tadaaaa: the error is gone.
This can also happen if you have two projects and one is running, and you try to run the other one. The solution is to stop the other one before starting the desired one.
This ca also happen if you had some kind of crazy bug and the simulator is unresponsive, in this case the debugger remains attached, crying over it's beloved simulator. You have to close the xcode simulator and sometimes restart for this one.
I have the latest xcode version at this time and got fustrated for a while. Now I'm free from restarting the simulator, xcode, coputer, router, going to sleep and waking up the next morning... :D
Hope this helps you guys apple has a lot of weird unclassified exceptions in xcode. They could least say that the debugger is still atached to something in the memory, we are programers not ordinary users, the more errors you give us the better we understand how to avoid them.
My personal favorite si when xcode puts absolute paths to your newly added famework that go nuts triing to find out why it doesn't work on an other computer (The project in wonderland syndrome).
(and rant rant rant irony rant.. you get the idea)
Quit the xcode and simulator ,and try to restart your mac
Quit the simulator and try again.
Your mac might be opening iPhone Simulator automatically, In order to stop this you can run Terminal, OSX's version of command prompt, by navigating to ~/Applications/Terminal.app
from there you can run these commands.
top -u This command shows the mac's processes, and some information about them, from there you can see whether iPhone Simulator might be open.
sudo killall iPhone\ Simulator Deconstructing this command for you, sudo puts you into superuser mode, by having you enter your login password, killall : This command kills all processes by the name specified. iPhone\ Simulator: This being the name of the app, and in order to have a space requires the \ (space) before the second word. By running this command you will kill all processes called iPhone Simulator.
If this doesn't help, then try rebooting.
If rebooting doesn't help try re-installing XCode.
If re-installing XCode doesn't help, then try re-installing your Operating System entirely.
Good Luck!
There are three solutions for this issue:
Right click the simulator on the Doc, quit and then re-run the application from the Xcode.
If this did not work, then -
Save your code, Right click the Xcode, restart the Xcode with your project and then run again. Remember to select simulator instead of device in the target.
If this also did not work, then,
Force Close - Simulator/Xcode - Restart your mac and then run Xcode again.
Most likely - the first step would be enough!!!
To get the simulator to stop whatever is running you need to check off the box "Do not show this message again".
Example:
And then click the box.
And then you can run the simulator even if a program had already been running.
I've been having this issue as well, but for me the problem doesn't have to do with XCode or Simulator.
The problem was in my code. A process was making the CPU run at 100%, and fixing the bug in my code fixed the simulator problem.
Force Quit both, iOS Simulator and Xcode, then reopen Xcode and run project.
Two Possibilities.
1)just quit the simulator,and run the application you want to run
2)just stop the application that using the simulator and run the application you want to run
Try these steps in increasing order of persistence of the problem:
Quit the Simulator.
Clean the project, Reset Simulator, Delete 'Derived Data'.
If nothing works, Force Quit Xcode and Simulator from the Mac Menu.
Force Quitting Xcode seems to always work for me.
It was one sticky Xcode bug indeed. Now it's solved, happy coding!

iPhone provisioning first time try problem

This is my first try in moving my app to a device. I was able to launch the app by clicking on the start button on XCode to launch it on my iPhone. I stopped the app and see if I want to try whether I am able to run it without being plugged. I can still see the app icon on my iPhone but when I launch it.. it immediately closes. What am I doing wrong?
I fixed the error, it was a stupid %# where I need %f.
First delete your application from the device and run again your application from the XCode on the device and run it thoroughly while the device is connected and then try to run the application. It should then work.
It is not related to provisioning. Environment is different when the program is being debugged. Plug the iPhone back to computer and check the crash log in XCode > Organizer > Device > Device Log.

How start a debug session in the simulator with previous app state

I have a hard-to-catch error that only happend the 2 or 3 time I start my app, after a previous failure of it.
But because when I do Run&Debug from the XCode menu the app is delete from the simulator or device, I can debug it to find what is happening.
I try to attach to the process, but when I succed is too late and the app crash. I have the data of the crash, but can't make sense of it (and anyway, I want to know the trick!)
So, how I start dirty from in the xcode debug session so I can debug AFTER the first run of the app?
Instead of choosing "Build and Go" or "Go (Debug)" you should choose "Debug" from the "Run" menu--that will just re-run your app, but not re-install it.

App crashed in Beta on the device, but not in debug

I've created a Beta ad hoc delivery profile, and when I press 'build and run' on the device in beta mode, my app crashes after I press a button.
However, when I use the app in debug mode (on the device) it works fine. It also works fine in the simulator and on the device in beta mode (when it's not connected to XCode)
Any ideas what's up here? It doesn't bother me too much since I can debug in debug mode...but I'm wondering when it comes to the submission process, if this will be a problem?
Thanks!
EDIT: Would this happen to be because I've got an entitlements file (dist.plist) with the option 'get-task-allow' unchecked? I tried checking this box but got an error "The executable was signed with invalid arguments"
There are many areas that can be the culprit. You may have an #if or #ifdef DEBUG, or you could have (more likely) some source or xib that is not included in the Beta Target.
You should be looking in the log, whether during its run via Xcode or after when you plug the device back into your Mac and look at the log file using the Organizer window, for more details of the crash. If it is related to clicking on a button, look at the path between the the button's actions set in the xib and the selector in your code. Sprinkle some NSLogs in there to help you out.
I have experienced this with applications that interact with other systems where timing is critical and debug mode affects the timing of the interaction with the other systems. Specifically when screen scraping an IBM mainframe but any time critical application may experience this.

iPhone Device Debugging

Is it possible to actually use the Xcode debugger when running an iPhone app on the device rather than the simulator? i.e., can I have the device stop at breakpoints that I set in my code and step through the code as it runs on the device?
EDIT: I should mention that I am a registered developer with Apple and have a valid certificate. In fact, I can build and run iPhone applications on my device just fine. However, even in Debug mode, my application will not stop on breakpoints or output to the console when I run it on my device. If it helps, my application will function normally in debug mode (e.g., stopping at breakpoints) when I run in the simulator.
EDIT 2: I've tried resetting my phone, completely removing and reinstalling Xcode, creating a new project, changing all the settings mentioned in the answers on this page (as well as others), cleaning and building my project, Build and Debug... If I click Pause, it says "Error from Debugger: Quit". :( Maybe I'll try to debug on this device using Xcode on another computer and see what happens.
EDIT 3: Well, I tried using another computer using a fresh install of Xcode in a new project, and I still can't get device debugging to work. I have a suspicion that it's my iPhone or cable perhaps? I'd like to think that I'm not so incompetent that I've missed something so embarrassingly obvious, but I've double- and triple-checked all of the suggestions mentioned here.
EDIT 4: FINALLY got device debugging to work. I have a feeling that something low-level on my device was causing issues...nothing I did worked on my system. However, I installed Xcode on another system and device debugging on the same device (with the same cable) worked flawlessly. Directly after that, device debugging began working on my original machine, leading me to believe that some strange hardware flag was screwed up and somehow "reset" on the second machine. In any case, it works now... Thanks for all the help. :)
Also, I'm unsure if it's better to leave this question unanswered or pick the most "helpful" answer...
Yes -- just use a device build. You have to get certificates and provision it.
This is a good description:
http://boga.wordpress.com/2008/07/16/debugging-ipod-provision-profilescertificates/
Make sure to start debugging by pressing "Cmd-Y"... and not "Cmd-R" :-)
You may try last trick in case nothing can help.
If your application launched successful on your device from XCode but did not stop at breakpoints - try press "pause" button after start in debug mode. If you will see application paused properly (do not react to user's action) add new breakpoint then press "run" to continue application execution. In some cases it may helps to stop at new breakpoint.
Yes, just set your project to build for the Device.
If you need to setup debugging for jailbroken iPhone (up to 2.2.1) (not pay 99 to Apple yet) follow next steps:
Install MobileInstallationPatch for your iPhone via Cydia (use Search Tab)
Switch off PROVISIONING_PROFILE at XCode: Go to /Developer/Platforms/iPhoneOS.platform/Info.plist, add next keys:
<key>PROVISIONING_PROFILE_ALLOWED</key>
<string>NO</string>
<key>PROVISIONING_PROFILE_REQUIRED</key>
<string>NO</string>
You may also add these keys to any
project particularly at XCode, Project
Build Settings, User-Defined
variables.
Add key to your project Info.plist at XCode
SignerIdentity = Apple iPhone OS Application Signing
Don't forget to install and add to your project settings self-signing certificate from Apple
http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW2
"Build and Go", you can connect iPhone and start debugging.
Important! You may need to install and launch at least one legal app (any free one) from App Store first (before "Build and Go" step). Otherwise your application will be successfully installed by XCode to your device but may not be launched. Try this troubleshoot first in case of problem with app launching.
Yes. Debugger and performance tools work fine on the device. That's where I do most of my debugging.
Xcode>preferences>debugging uncheck load symbols lazily
fixed the breakpoints not holding in device problem for me.