How to access memory leaks tool while testing on iPad device? - iphone

So I'm using the memory leaks debugging tool by selecting "Profile" under the "Run" submenu.
I can run and record fine on the iOS simulator, but if I select my iPad device, the record button is greyed out/unselectable. I tried messing with my Profile scheme, changing it to Debug and Instrument: Leaks but its still greyed out. The app doesn't execute in my iPad either, like it normally would on Run.
Any ideas? Thanks

Probably.. you are missing the developer profile..
1. change the build settings
2. Select the developer profile in build settings
3. Build the application
4. Try to profile this with instruments.

Related

Time profiler in Instruments

I am having trouble launching Time Profiler in Xcode, both for Mac Applications and iPhone apps.
The steps I have tried are opening Time Profiler, Clicking the choose target drop down box, selecting my iPhone or Mac book. Choose target -> myApp. If I choose a Mac app then I hit the record button a big yellow warning pops up accross the window saying unable to configure sampling trigger for x. If I choose an iPod app then the record button stays greyed out and cannot be clicked.
Any ideas what I'm doing wrong here?
Have you tried starting Instruments via (in Xcode) Run -> Run with Performance Tool -> Time Profiler? That may help set up Instruments and get you running v. launching Instruments manually.
Also, I have had trouble in the past where the SDK used to build the iPhone app differed from that which Instruments was expecting. Check out the Instruments documentation on how to explicitly tell it which version of the iOS you are running to perform the benchmarking.
Sometimes Time profiler is greyed out because you dont have application install on simulator...if you have application installed on simulator and then you try Run with Performance Tool it shows Time profiler enabled.

App settings appear in simulator but not on device?

Hey folks, I'm setting up my first application settings bundle right now. I went through the process of creating a Settings.bundle in the project root, settings the Root.plist to display as an iPhone Settings plist, etc.
So – the app's settings panel displays in Settings.app just as I would expect in the iPhone Simulator. However, it is not present in my device settings when I deploy there. My test device is an iPod Touch running iOS4. I've rebooted the device just to make sure everything has reloaded... still nothing. Can anyone think of a reason that my settings panel would work in the Simulator but not on my Device?
Thanks for you help!
You may need to run your app at least once after installing your app before the app's setting will appear.
Not sure if a quit and restart of the Settings app (from the "multi-tasking" bar) might also be required.
I've experienced this myself - it usually happens when you mistype a key in the plist or if required keys are missing.

Cannot choose "Run with Performance Tool" -> "OpenGL ES" in Xcode 3

In Xcode3, out of all options under "Run" -> "Run with Performance Tool", I can only select:
Leaks
CPU Sampler
Allocations
Activity monitor
I cannot select any other option including "Zombies", "UI Recorder", etc., or most importantly for me, "OpenGL ES". I think this is consistent in all iOS projects on the machine, but I did not check.
How can I profile OpenGL ES?
Some of the options of Instrument are available only on the Device.
Connect device, change the build from simulator to device... build the app first then try using
instrument and see if your getting what you looking for..
You must first run the project in Xcode, then select the Attach to Process option in Instruments and select your running application. It works for me.
You could run Instruments solo, it's a regular app and you don't have to launch it from Xcode. Then attach to your process and instrument away...

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.