iphone - debugging on device crashes immediately - iphone

When I try to debug my app on the iphone device, the splash screen shows and then the app crashes immediately. If I run the app in the simulator or on the device (not from XCode) it runs fine. I tried putting a breakpoint in the main method and it doesn't seem to hit it. There are no logs generated. ideas? suggestions?

Are you using a Apple Developer account or have you hacked the phone to develop on it? If its hacked, that is probably the problem. There is extra data being passed to the device because of the hack causing it to crash. Not sure if there is an easy work around except paying for a developer account.

Related

iPhone crash logs

I have an app in ad-hoc mode and it crash right after starts. I have access to Xcode and i try to find crash log like here: iPhone crash log?
But i have no crash log from this app. Why?
Right after app starts i can see Default.png and few second later it crash, i've never even see the mainViewController. How do get a crashlog? How to detect this error? I don't have an access to source code. I have only ad-hoc distribution.
Problem not occurs on every devices. AFAIK this is only 3GS problem. Strange.
Instead of looking for the crash log, try connecting your phone to xcode but look at the Console screen instead, run the app and you should see output on the console, see if you get an error message there.
For users who don't have access to Xcode or are running on a PC you can download Apple's iPhone Configuration Utility which also gives you access to the device console.

When debugging with XCode, app works fine, when running it on device or simulator, app crashes

My application crashes when freely running it on a real device or in the simulator. When I'm running it with XCode attached, the app works fine.
The app doesn't give me any errors and since I'm not running it with XCode attached, there is no message sent to the logger.
Any idea of what could be wrong or how I could find out what causes this crash?
Thanks!
You can read about CFRelease in detail in the following thread
Cheers
If you just want to test in a device why don't you try through iTunes. Find the Target of your project in the Finder, then drag it to iTunes. You can then sync the applications. This is not a solution but an alternative to run the app on your device.
Thanks Aditya,
The crash logs in the Organizer are actually very well detailed and they even include the line of code in the implementation file where the app crashed. When going to that line of code it seemed that I was CFRelease -ing a ABRecordRef, which is an integer of some kind...therefore I shouldn't release it
The weird thing is that it didn't crash or complain while debugging, but when running it on the device it did.

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.

Problem with app on device

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.