Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
File Modsforums, a part of the
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...
01-30-2012, 03:45 PM #1
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.
- 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)
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
$ git clone git://git.libusb.org/libusb.git
4. Build libusb.
$ ./autogen.sh $ chmod 775 build-ios.sh $ sudo ./build-ios.sh
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.