Necessary files to interact with iDevice in C/C++?

Discussion in 'iOS Development' started by mohitd2000, Jun 23, 2010.

  1. mohitd2000

    mohitd2000 Member

    Joined:
    Jul 6, 2009
    Messages:
    231
    Likes Received:
    0
    Device:
    3G iPod touch
    What are the necessary files to communicate with an iDevice in NATIVE C or C++ code? I have heard of a C file set called usb.h and usb.c that allows you to do this. Openiboot and iRecovery both have usb.h and usb.c so I THINK that it is necessary, but I'm not sure. How would I issue simple commands like reboot, respring, display a popup (UIAlert). What is the best library? I am running Windows 7/Cygwin so please no .dylibs.
  2. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    Uhm i dont know what you are talking about.
    iPhone development uses Obj-c. Which uses files .h and .m
  3. mohitd2000

    mohitd2000 Member

    Joined:
    Jul 6, 2009
    Messages:
    231
    Likes Received:
    0
    Device:
    3G iPod touch
    No no no, I'm not talking about DEVELOPING FOR the iPhone. I'm talking about how programs like redsn0w, iRecovery, Openiboot, recognizes your iDevice once you connect it to your computer and send commands like
    Code:
    killall SpringBoard
    to restart your springboard. How could I do that in C/C++? iRecovery and Openiboot both have a usb.h and usb.c file, so I THINK that those files are important.
  4. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    Oh my bad. Im guessing they connect through ssh and terminal or something i have no clue about that, sorry.
  5. mohitd2000

    mohitd2000 Member

    Joined:
    Jul 6, 2009
    Messages:
    231
    Likes Received:
    0
    Device:
    3G iPod touch
    They connect through USB actually.
  6. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    For normal "Userland" (AKA not recovery/DFU) communication, you need to connect to usbmuxd. Some dev team members have documented it, but I'm not sure where to look right now. Basically, on your Mac/PC, you connect to usbmuxd using its socket, and send it messages in a special protocol that get converted into TCP messages on the iPhone.
  7. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    I know for Linux/Mac there's libusbmuxd (Google it). It will probably compile under Windows, too. I don't see a reason why it wouldn't, as long as you have libusb installed.
  8. mohitd2000

    mohitd2000 Member

    Joined:
    Jul 6, 2009
    Messages:
    231
    Likes Received:
    0
    Device:
    3G iPod touch
    Will http://www.libimobiledevice.org/ work? I requires usbmuxd. Also I check the spirit jb source code and libmobiledevice is included. And even has API documentation!!!!!

Share This Page