在pc上,不管是windows仍是linux均可以鏈接管理你的ios設備,那麼如何去實如今arm平臺下與ios通訊呢,其實你你須要把linux下的usbmuxd和libimobiledevice交叉編譯就能夠了,管道就打通了,接下你也能夠用ssh或ifuse。linux
#編譯環境:ios
系統:Linux 2.6.32-74-generic #142-Ubuntu SMP i686 GNU/Linux 交叉編譯器: arm-none-linux-gnueabi-gcc RDK: DVRRDK_04.00.00.03(沒有這個能夠根據須要編譯本身須要的庫) 設備: arm linux板(dm368)+ ipone5s(ios8.3) +usb線
#編譯步驟 ##環境配置git
export PREFIX=/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr export HOST=arm-none-linux-gnueabi export BUILD=x86_64-unknown-linux-gnu export LD_LIBRARY_PATH=$PREFIX/lib export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig
##libusbgithub
Package: libusb-1.0.8.tar.bz2windows
a. 先聲明上面的環境 b. ./configure --build=$BUILD --host=$HOST --prefix=$PREFIX --disable-static --disable-log c. make d.make install
##libplistssh
Package: libplist-1.3.tar.bz2工具
這個須要用cmake編譯,本身寫一個toolchain.cmake 修改交叉編譯變量ui
# this one is important SET(CMAKE_SYSTEM_NAME Linux) #this one not so much SET(CMAKE_SYSTEM_VERSION 1) # specify the cross compiler SET(CMAKE_C_COMPILER /opt/arm-2009q1/bin/arm-none-linux-gnueabi-gcc) SET(CMAKE_CXX_COMPILER /opt/arm-2009q1/bin/arm-none-linux-gnueabi-g++) # where is the target environment SET(CMAKE_FIND_ROOT_PATH /opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
而後在源碼目錄下 新建build文件夾this
mkdir build cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake .. make DESTDIR=$PREFIX install
##usbmuxd.net
Package: usbmuxd-1.0.4.tar.bz2
編譯方法和libplist是同樣的。
如今通道已經打通。 ##後續 採用上面的方法,你也能夠編譯出 libgpg-error
Package: libgpg-error-1.7.tar.gz
libgcrypt
Package: libgcrypt-1.4.6.tar.gz
libtans1
Package: libtasn1-2.7.tar.gz
gnutls
Package: gnutls-2.8.6.tar.bz2 須要修改一下src/makefile 的LDFLAGS 值
LDFLAGS=/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr/lib/libgcrypt.so /opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr/lib/libgpg-error.so
##libimobiledevice
新建一個build.sh
./configure --build=$BUILD --host=$HOST --prefix=$PREFIX libusbmuxd_CFLAGS="-I$PREFIX/include" libusbmuxd_LIBS="-L$PREFIX/lib" libgnutls_CFLAGS="-I$PREFIX/include" libgnutls_LIBS="-L$PREFIX/lib" libtasn1_CFLAGS="-I$PREFIX/include" libtasn1_LIBS="-L$PREFIX/lib" libplist_CFLAGS="-I$PREFIX/include" libplist_LIBS="-L$PREFIX/lib" libglib2_CFLAGS="-I$PREFIX/include -I$PREFIX/lib/glib-2.0/include" libglib2_LIBS="-L$PREFIX/lib" --without-swig LDFLAGS="-L/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr/lib -L/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr/usr/local/lib -lusbmuxd " CFLAGS="-I/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr/usr/local/include -I/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr/include"
sh build.sh make make install
也許你須要繼續 編譯fuse 和ifuse ,那麼你就能夠去mount ios設備了
文章參照 Mounting an iPod/iPhone on a Linux device http://paguilar.org/?p=31
##補充說明
上面usbmuxd的1.0.4版本不支持ipone5s 的ios8.3,又試了usbmuxd 1.0.7 是ok的。 我只使用了發現設備鏈接設備(libplist usbmuxd),打通管道,你也能夠編譯文章提到的其餘工具,甚至寫個qt程序。