Problem with app on device - iphone

When I run my app with simulator every thing is ok.also when i run it on device (ipod touch 3G) for the first time,i have no problem but if i close my app and run it again,it hangs(no button working & just i can uninstall it) and if i try to minimize it ios seems out of action(every thing is being black)
how can i solve this problem ?

Run your application in the simulator with the profiling tools, making sure you check for allocations / releases and if there are any network resources left open.
You haven't said anything about what your app does to give any more help than that, but the development tools will tell you what is going on.
Also when you connect to the iPod, check the crash reports to see what happened

have u release any object in appWillTerminate. may be u trying to release object that is already released before the application quit. or u can see the application quit status in nslog if status is not 0 means application is not quitting properly.

Related

"Watchdog has expired" when I debug app with iPhone in Xcode

From yesterday, My iphone couldnot debug any apps.
In xcode, when I choose my iPhone as the debug target, and xcode build the app, link, and run into my phone, several sencond later, the xcode finish running in my iPhone. And the console below show "Watchdog has expired. Remote device was disconnected? Debugging session terminated."
It is iPhone4s, iOS version is 5.0.1, and had jailbreaked, and update Cydia a few days ago.
It could not work on my other MBP yet.
How can I recover it?
This is because of the bug in Cydia update and Jailbreaking.
Hope this helps.
Refer to this post:
App crashes with "Watchdog has expired." message. No stack trace or crash dump
Here is tc.'s answer from that post
"Watchdog has expired." could mean anything. The way the message is
worded suggests that the "local" GDB (running on your Mac) GDB timed
out waiting for data from the "remote" GDB (running on the phone).
Alternatively, "Watchdog has expired" might be from the phone's
console output shortly before it reboots.
What does it display if you disconnect the device while your app is
running? What if you power it off? What if you issue a hard reset
(Sleep+Home for 10 seconds)?
If it's causing the device to reboot, there's something seriously
wrong happening. Your app shouldn't be able to take the phone down,
but sometimes something slips through (IIRC, UIImagePickerController
on some version of 2.x had a problem where either your app would get
killed or the phone would reboot, depending on which kicked in first).
"Large set of bitmaps" sounds like it might be causing CoreAnimation
(or IOSurface or whatever) to run out of video memory.
I would hesitate to do drawing in a background thread unless you're
very careful about thread-safety (to a first approximation,
CoreAnimation is and UIKit isn't except a few functions that were made
"thread-safe" in 4.0).
Hope this helps you.

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

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.

Application crashes after installing iOS 4.2

I recently installed iOS 4.2 for my iPod after then my application started to crash.
The scenario is: I launch my application wait until it's up and running then hit the iPod home button then launch my application again, my application starts again for seconds then crashes.
my application is a job search engine, so in all of its navigation pages it's communicating with internet server.
I think the problem has to do with applicationDidEnterBackground, applicationWillEnterForeground, or applicationDidBecomeActive methods. I do not have an code in these methods and I do not know if I need to, to prevent the crash.
I do not understand what happens after I hit the home button and my application goes to the background:
will it still be running in the background (because of the multithreading thing in iOS4.2).
Sometimes when I relaunch my application it goes to last page I left in before hitting the home button and sometime it starts from the home page.
I do not understand what's going on, I just want it every time it starts to start in the home page.
I was just about to submit my application to the Apple Store just before I updated to iOS4.2 and the crash starts to happen. I'd really appreciate if someone can help me with this issue that I'm not even able/or know how to debug.
Thanks a lot in advance.
Regards,
You can set the Info.plist key ApplicationDoesNotRunOnBackground to make sure the app is completely terminated.
Xcode / Organizer will show your device crash logs.
Xcode -> COMMAND+CONTROL+O -> Device Logs or you (making sure the device is connected) can select the iPod from the list of devices, then choose Device Logs.
You don't need to have any code in the applicationDidEnterBackground, applicationWillEnterForeground, or applicationDidBecomeActive delegates, so that's not making your app crash.
I would definitely check out some of those logs in Organizer. Maybe post some of them here, or pastie.org

iphone app cant be started on device after being killed - works fine on simulator

I want to put an update to my App and I'm encountering heavy issues. When sent to background and being brought back to foreground, the App works fine. However, after killing the process from multitasking (running in the background), the App tries to resume from the point where it left AND it freezes, which means, I cant start the App anymore!!!! I have made no changes to the code, except updating my OS from 4.0 to 4.0.1.
Can anyone help me out on this?
A weird thing is: I cannot reproduce this problem on the simulator, it works just fine there.
I seem to have found the solution. Apple states in the updates: 'When debugging your multitasking enabled app, avoid manually pausing and continuing from the debugger when the application is suspended in the background. Pausing an application that is suspended in the background disrupts proper multitasking behavior until the application is relaunched.' So I tested it on a device for distribution and it seems to work fine, so all you have to do is ignore the debugger - it seems. Best of luck!
My app works fine for me in Debug mode (I'd advice against working with Distribution mode cause of all the hassle of provisioning profile, iTunes sync... and also you can't see the console message in real time).
The reason you can't do anything after killing the app and relaunching it is most likely because you run it directly from XCode (Command + Enter) and the app is still "running". Just click to the Red button to stop the debugging, then you can relaunch the app from the SpringBoard normally. Or just Command + Enter to rebuild it again.

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.