App doesn't get fully launched with Instruments (Allocations) on the device - iphone

Instruments launches my app on the device and listens to the allocations. (In "Allocations" mode) It launches extremely slow. Then the app quits after about 35 seconds. On the simulator Instruments runs fine.
Is there a solution to this? Is iOS killing my app? How am I supposed to debug this if Instruments increases launch time that much?
Thanks in advance
I'm on a iPhone 3G (iOS 4) with XCode 3.2.3

Any message from Instruments.app? I have had a similiar problem until I build for the device in debug mode and used a development provisioning profile for it. A distribution profile even compiling fine in debug mode hasn't done the job.

Related

App crashes on device and while using instruments only

I am encountering a strange behaviour, my app runs smoothly on simulator but crashes on device.
Also when i try to detect leaks using instruments it just crashes on both simulator and device.
I am totally stuck as i am not even able to generate any error message on console, also NSZombieEnabled is on in the settings.
I can see two possible reasons for the behavior you describe:
device is short on memory; (but you would see some processing in this case)
your app uses a newer SDK than what you have installed on your device (like using the SDK 5 twitter framework and then running your app on an SDK 4 device).
Specifically, in case 2, you would not see any log messages because the app would fail as soon as it tries to load the missing framework in memory.
In any case, inspect the device log in Xcode Organizer window to have more info about the crash. This is the only way you can understand what is happening.

How can i deal with instruments hanging issue?

I am stuck with instruments for iPad app.I am developing app with map view.I can run instruments with iPhone for memory leaks and it's work fine.But problem is that for same code and same app instruments is not running with ipad.I checked my entire code but there is no such problem.Even Instruments is running with iPad simulator for same code.
If i start interments after loading my app on my device than it will give following message.
Failed to start Instruments daemon for 'iOS' on 'iPad (v4.3.5)' ((null))
I am using Xcode 4.0.2
Please Help me,
Thanks In ADvanced.

app crashing on device

the app I've installed on an iPhone 3G device periodically crashes. I'm wondering if it's the device or the code. the code works fine on the simulator.
I have other apps from the app store that do the same thing. e.g. the stackoverflow app - whenever I do a search the app crashes. I've even had the iPod app crash too.
I've restored the phone a few times and still the same thing. I'm getting ready to upload the app to the app store and was wondering if anyone had any tips to make sure that my code is not the problem. it's difficult to tell because there are no errors in the simulator or memory leaks in Instruments
thanks in advance.
You can be guaranteed that it is your code. Run it in the debugger on the device and see where it is crashing. If you are getting EXC_BAD_ACCESS use the following to help track it down
http://www.cocoadev.com/index.pl?NSZombieEnabled
It most certainly is your code that crashes.
Run in debug mode and watch the console (real debug mode, not only the debug target).
Also, you can (and should) grab the crash report from the organizer. You can also watch the device's console there.
Are you sure you are not running out of memory?
the easiest way to see if this is your problem is to implement didReceiveMemoryWarning method of your controllers and check if they are called.
In the simulator you can simulate a memory warning but I am not sure if even in simulator app will crash if memory is not released. (I believe not)
Also run your app with instruments, using allocations: Run > Run with performance tools > Allocations.
And use your app for a while and you will see. ;)

iPhone 3G + iOS4 debug problems

I recently updated our test iPhone 3G with the latest version of iOS 4 to be able to test our apps on the new OS. I regret that I didn't read the forums because after the update the device's performance suffered a lot. However this is not a problem because the device still works. The problem is that when I try to debug our app the device freezes for minute and reboots or closes the app and returns to the home screen. When it manages to stop at breakpoint it takes few seconds to step over or out and often there's no debug information about the variables. I assume that this is due to some memory issues because the new OS requires more memory space. I must point out that our app worked fine with the iPhoneOS 3.1.3 and the Xcode 3.2.2 with the 3.2 SDK. It is a Universal app and that runs fine on the iPad too.
I have seen this problem as well when one of my applications was consuming a lot of memory. The background application that handles the remote debugging consumes quite a bit of ram (~15M the last time I had this problem). If your app is fine in standalone mode and crashing under debug then you might be close to the limit running in standalone (as I was).
I noticed that making sure that all other applications were quited or if I rebooted the iPhone that I was able to debug my executable (this was until I found the copied object problem that was causing the memory bloat).
If you have a jailbroken iPhone then you will have other services running consuming memory as well.
the iPad has double the ram 256M than the 3G at 128M.
I have also seen a problem when opening an application with a url encoded with data that runs > 500K that it will crash springboard before your debug session is started with a delayed launch.

getting Xcode to build my iPhone app on the iPhone Simulator after setting up my physical iPod to test with?

I am new to developing apps for the iPhone. I just went through the entire process the other day of properly setting up my developer account to allow me to test my programs on my physical iPod. Once I set it up though, I was not able to figure out how to get the iPhone Simulator working again. I would like to test my programs quickly with the simulator and then test major revisions periodically on the physical device. How can I adjust the target of the compiled program to test? Any insight would be appreciated. Thank you for your time.
Change the active SDK to "Simulator"
Project -> Active SDK -> iPhone Simulator 3.1.2