Debugging Toolchain Apps on iPhone

Discussion in 'iOS Development' started by ipwnedmyphone, Feb 10, 2009.

  1. ipwnedmyphone

    ipwnedmyphone New Member

    Joined:
    Dec 3, 2008
    Messages:
    6
    Likes Received:
    0
    So, I had some success with a couple of simple apps for the iPhone. They compile fine and run fine on the device.

    I advanced to programs using a database. The app compiles fine, but when I load it to the device and start it, the app crashes after displaying the Default.png. I have set the permissions appropriately, and also used ldid on the app.

    Is there any specific location to keep the database file (the app is in /Application/SampleDB.app)?

    Is there anyway to debug the application by adding some print statements? I am working on a windows machine so am only using a toolchain and not able to identify the point at which it is conking off.

    I tried running the app from terminal on iPhone by issueing "./SampleDB" when logged in as root. But nothing happens, The application doesnt show up nor does any error message. I have to click CTRL-C to break the command.

    Any pointers on this?
  2. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    I'm not sure if this is what you want but to print a message so say you can tell when a button has been pressed you can use printf ("your message here");
  3. ipwnedmyphone

    ipwnedmyphone New Member

    Joined:
    Dec 3, 2008
    Messages:
    6
    Likes Received:
    0
    Thanks for the suggestion. I'll try it out.

    Will this help me in printing messages to the terminal even for GUI applications?
  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    not sure with terminal but in xcode if you use the printf function it displays the message in the GDB is that terminal I am not sure I've never done debugging on my phone, only in Xcode. And yes it works in GUI apps
  5. ipwnedmyphone

    ipwnedmyphone New Member

    Joined:
    Dec 3, 2008
    Messages:
    6
    Likes Received:
    0
    hmm...i just tried using printf.

    Only the statements upto "UIApplicationMain(argc, argv, nil, @"AppDelegate");" are printed. After that, nothing. I guess when the GUI code is supposed to be fired, it doesnt execute properly, as it is being run in the terminal....and it just stays there.

    Need to look at an alternate way.

    Is there any logging in iPhone?

    EDIT: Ive seen that intelliscreen writes log messages to /tmp/intelliScreen.log
    It looks very structured like normal debug APIs that we get.

    Does anyone have an idea how these are done?
    ------------------double post merged------------------
    Great!!

    I got the way to debug/log from iphone apps to phone.

    Followed the instructions here

    Ill soon post a detailed tutorial for this.

    Please Register or Log in to view images

Share This Page