+ Reply
Results 1 to 1 of 1

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: HOWTO: Using libusb on iOS 5 with the iPad Camera Kit

is a discussion within the

File Mods

forums, a part of the

iPhone Modding

section;
Libusb is an open-source C library for creating drivers for USB devices across different OS's and devices. It also works on iOS, although, I have never seen any tweaks/apps using
...
  1. #1
    iPhone? More like MyPhone
    Join Date
    Sep 2009
    Location
    Netherlands
    Posts
    134
    Thanks
    7
    Thanked 26 Times in 19 Posts

    Default HOWTO: Using libusb on iOS 5 with the iPad Camera Kit
    Libusb is an open-source C library for creating drivers for USB devices across different OS's and devices. It also works on iOS, although, I have never seen any tweaks/apps using it. You could, for example, tweak some dj app to work with your USB turntable or you could make your game controller work for games.

    Requirements:
    - You have a jailbroken iDevice(with openSSH) and the iPad Camera Kit (I have only tested with iPad 2, but it should work on iPhone 4 too)
    - You have Xcode with the iOS 5 SDK installed.
    - You are able to make a tweak/program for a jailbroken iDevice
    - You know how to use libusb

    1. Make a symlink to IOKit.
    In Terminal: (Change this according to your OSX and iOS version)
    Code:
    sudo ln -s /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/IOKit.framework/Headers /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/IOKit.framework
    2. Download the newest libusb. (1.0.9b3 at the time of writing; 1.0.8 doesn't work as far as I know)
    In Terminal:
    Code:
    $ git clone git://git.libusb.org/libusb.git
    3. Download build-ios.sh and put it in the libusb folder.
    build-ios.sh.zip

    4. Build libusb.
    In Terminal:
    Code:
    $ ./autogen.sh
    $ chmod 775 build-ios.sh
    $ sudo ./build-ios.sh
    5. Copy the content of libout to /usr/lib/ onto your iDevice.

    6. Also copy the content of libout to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/ on your mac. (change this for your iOS version)

    7. Copy libusb.h from the libusb folder(so libusb/libusb) to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/ on your mac.

    8. Build your libusb app/tweak with this SDK and put it onto your iDevice. (don't forget to add -lusb-1.0 to the compiler flags)

    9. Copy your app(or the app you tweaked) from /private/var/mobile/Applications/***/ to /private/var/stash/Applications/ to circumvent sandboxing restrictions.

    10. Respring and connect the device to your iDevice with the Camera Kit. Your app should be able to access an USB device.

    Important: I don't take responibility for any malfunctioning related to this howto.
    Last edited by koekje00; 01-30-2012 at 03:49 PM.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts