Debugging on iOS without a paid developer membership (3.x) - iphone

I currently have it set up for Xcode to Build & Go onto my iPod using this: http://il.youtube.com/watch?v=CHOVdi-kPV0 (A script to tell Xcode that it doesn't need to codesign). This works, except when the app launches, it closes instantly and Xcode says it failed to launch. You can manually reopen the application and it works 100% after. The problem is I need to be able to build & go through Xcode, and have the application stay open so I can debug on the device. Does anyone have a way to do this?

I followed this guide and it worked for me: http://www.alexwhittemore.com/?p=354

Related

HOWTO attach to a released App on the iPhone? not a debug version

I've tried to attach to a debug App using Xcode : Product -> attach to process, and it works.
But when I tried to attach to an App installed from the App Store, the Xcode firstly said waiting the App to launch, and when I launch the App on the iPhone, Xcode just finished running the App on my iPhone... nothing else.
My problem is that my app released on the App Store has a bug, I want to attach to it to debug.
Many thanks.
For the reason (#Kendall Helmstetter Gelner):
This bug is hard to track, and I have an iPhone meet it.
You cannot debug an app store application. It would be foolish to allow such behavior. You don't want some random script kiddie trying to use the debugger to hack into your app. You need to fix the problem another way. Test your release build and confirm the differences (if any) between a normal release build and your app store build.
In short, test your release build from Xcode (build it with your development certificate).
"Once you have deployed your app, either through the App Store or as an Ad Hoc or Enterprise build, you won't be able to attach Xcode's debugger to it. To debug problems you'll need analyze Crash Logs and Console output from the device."
https://developer.apple.com/library/ios/qa/qa1747/_index.html
as far as i know, its not possible to attach an app in release mode.

Fail with AdHoc distribution for iPhone 2G

I have some issues with my application. So, first time I have deployed the application for AdHoc distribution everything went well on my device and on my tester device (iPhone 2G).
Now when he starts the new build on his device he is seeing the splash screen and after this the app crashes. The only thing changed on this new version is that I have added some new feature to the app, but nothing on the first screen. My iOS version is 4.3, xCode 4 and iOS SDK 4.3 and my tester has an iPhone 2G and iOS 3.1.3. The target for the app is set to 3.1.2.
I have included the following frameworks:
1) libz.1.2.3.dylib;
2) libxml2.dylib;
3) MobileCoreServices.framework;
4) CFNetwork.framework;
5) UIKit.framework;
6) CoreGraphics.framework;
7) QuartCore.framework;
8) SystemConfiguration.framework.
Could one of them be the cause? How can I find out what frameworks are available for, let's say, iOS 3.1.3? Currently all frameworks are set to "required".
Do you have any idea what could be the cause of this issue? I will post the code for the first screen if you find it relevant.
Thank you,
Andrei
You'll need to inspect the logs on your tester's device to find the cause of the crash. The console log may provide some help -- your tester can retrieve the console log by using the iPhone Configuration Utility that Apple provides. It can be downloaded from http://www.apple.com/support/iphone/enterprise/ for both OSX and Windows. If your tester downloads and runs this, it will give him a view pretty similar to the Organizer window in Xcode. Have him click his device on the left-hand side, and then the "Console" tab, and then save the log and send it to you.
The other thing that might (more likely) help is the crash log. If your tester connects to iTunes and does a sync, the crash log is copied to his computer. It can be found in
~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME> for MacOS
and either
C:\Documents and Settings\<USERNAME>\Application Data\Apple computer\Logs\CrashReporter/<DEVICE_NAME> or C:\Users\<USERNAME>\AppData\Roaming\Apple computer\Logs\CrashReporter/MobileDevice/<DEVICE_NAME> for Windows.
Hope that helps!
If your app is crashing on startup, you'll need to gather his crash logs and read those. There's a million ways an app could crash; we'd need a lot more information to help you diagnose the problem.

iPhone provisioning first time try problem

This is my first try in moving my app to a device. I was able to launch the app by clicking on the start button on XCode to launch it on my iPhone. I stopped the app and see if I want to try whether I am able to run it without being plugged. I can still see the app icon on my iPhone but when I launch it.. it immediately closes. What am I doing wrong?
I fixed the error, it was a stupid %# where I need %f.
First delete your application from the device and run again your application from the XCode on the device and run it thoroughly while the device is connected and then try to run the application. It should then work.
It is not related to provisioning. Environment is different when the program is being debugged. Plug the iPhone back to computer and check the crash log in XCode > Organizer > Device > Device Log.

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.

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.