run button in xcode 4 - iphone

Whenever I re-run my application by selecting the run button in xcode for, it says simulator already in use. So I have to stop it every time before re-running.
So my question is, is there any option or setting to avoid this. I want to run the application without stopping it like we used to do in xcode 3.

The issue is that pressing the Home button, even in the simulator, does not stop your app under iOS 4. You can either stop your app in the debugger, or in the simulator, or you can modify your app such that it doesn't run in the background. See Opting Out of Background Execution.

In Application PLIST file, we have a flag of “Application does not run in background”.
If you set this flag to “YES” and press home button, application will not maintain its status or perform any background tasks.

This is a bug in Xcode 4 which occurs sometimes. Usually you can make it go away by quitting the Simulator and restarting Xcode. If that still doesn't fix the problem, I would report the issue at bugreport.apple.com and see if the engineers at Apple can help.

Related

iPhone Simulator Translucent Black Screen and Hangs in Xcode 4.4.1

I have a problem with Xcode 4.4.1 .
My Simulator becomes translucent black and hangs without any proper log message when I pressed a login button of my application after app launch.
Sometimes application or Simulator hangs just after the launch when I pressed the button or Sometimes it hangs after few second I request a network call with in application.
No pattern .. no message to trace. Tried many things like Xcode restart ,System restart and Clear logs and deleting temporary iPhone Simulator files in Library like that .
I am not able to get what is happening . Does anyone suggest me solution to get out of this.
Or Does somebody know the reason why this is happening. I mean its the application problem i.e in code or the Xcode or iPhone Simulator App problem.
Any help would be really appreciated.
I faced the same problem last day. I got it working after I have done the following, not sure which step did the trick.
Reset the simulator contents.
Quit simulator
Delete derived data of the project from xcode.
Restart xcode.

iPhone App on click of home button closing app instead suspending

Hi in my iPhone app if use for sometime and click home button of iPhone and then again tries to reopen app app is launching from beginning its not suspending(its not pausing and playing),but sometimes it works fine, in all of iPads it works fine.
What may be the reason for this any help is thanks in advance.
You might have opted out of background execution by specyfing the key 'UIApplicationExitsOnSuspend' as YES in your applications plist file. See the attached image (iOS 5) and check your application's plist.
And as you have specified that it happens only sometimes I assume that it may be an application crash.

Slow xcode 4 debugger

I've some issues with the Xcode 4 debugger. While it was working fine before, now I can't run more than 1 build before restarting my xcode. When I run a second build for example after changing some codes the debugger could take like 30 mins and more before showing "build succeeded!" with iphone simulator launch. And in such cases, pressing "stop" button does not stop debugger. So, I've to close xcode and start it again. Now, after many xcode restarts I'm fed up especially as I don't know why it happens. Any idea to help ?
the simulator could still be running, chewing up a large chunk of your CPU, interfering with the compile, and the app restart inside it. Stop your app in the simulator before re-compiling. There must be a way to configure that, but i dont know it. Hope that is your issue (i have had it).
ps. state your config next time (Dev box specifics, XCode version, simulated iOS version).

iPhone/iOS App runs fine, but if I force quit by deleting it from the running programs crashes on next start

Ok, I'm confused..
I have an app that if I launch and use runs fine.. However if I click on the home button pausing the app, and then go into the list of running apps by double clicking the home button, and then delete the app instance in that list, effectively killing/ending that app run, and go back and click on the icon to launch the app fresh, the app simply hangs with a blank black screen... every time I try to start the app after that first time I get this problem.
Is there some event I need to handle in my app, to make sure it cleans itself up properly for relaunch?
I am admittedly confused and would appreciate any help.
I had the same weird problem, then i have realized that this only happens if you run the application through the XCODE (Debug Mode).
The application locks because the debugger/xcode receives the SIGNKILL and locks the application so you can inspect the code.
If you run the application directly from the device the application gets killed and does not remain locked on the screen :)
Even one year later, i had the same problem, so hope that helps someone that has the same problem.

Difference between running Iphone app through Xcode and running it through the Iphone

I'm having some strange behaviour ocurring when I try to run my Iphone app without using Xcode. If I run it by choosing Build & Run in Xcode it runs just fine, but if I do it by disconnecting the USB cable and tapping on the app on the Iphone, it crashes, yielding an unhelpful crash log.
Is there any difference between these 2 scenarios that could be causing this behaviour?
The difference is that if you run it via Xcode, the debugger is attached and a lot of restrictions are not applied. For example, if an app starts up it must respond with a few seconds otherwise it's killed. If you run it with the debugger, that restriction is lifted. Same when exiting: if you hit the home button (on iOS < 4 or iOS >= 4 without multitasking) then an app gets five seconds to exit. Not so with the debugger attached.
It might help if you post the error message from the crash log.
After having run the app out of XCode, have you terminated it? With iOS 4 it will continue to run in the background, and when you tap on the app on the iPhone, it just brought to the foreground.
Double click on the home button and see if it's still running. If so, tap on the app until the minus sign appears and tap it.