Linux下管理掛載IOS設備——libimobiledevice
https://www.jianshu.com/p/6423610d3293
https://blog.csdn.net/fengzei886/article/details/53380009
#####gitlib下載包--編譯安裝
git clone https://github.com/libimobiledevice/libplist.git
git clone https://github.com/libimobiledevice/usbmuxd.git
git clone https://github.com/libimobiledevice/libusbmuxd.git
git clone https://github.com/libimobiledevice/ideviceinstaller.git
git clone https://github.com/libimobiledevice/ifuse.git
git clone https://github.com/libimobiledevice/libirecovery.git
git clone https://github.com/libimobiledevice/libideviceactivation.gitpython
./configure
make && make install
##建立掛接目錄
mkdir -p /media/iphone
ifuse /media/iphone
idevicepair pair
idevice_id --list
##實時查看日誌
idevicesyslog|grep com.bxd.helplinux
#####################################################git
libimobiledevice 查看應用日誌github
iOS實時查看App運行日誌
前言:
本文討論如何實時查看輸出在console控制檯的日誌。shell
1、Xcode
版本號:9.4.1
windows
經過Window->Devices and Simulators,打開Devices and Simulators界面,選擇咱們的手機,點擊view device logs能看到手機中運行的進程輸出的日誌。如圖:
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
2、libimobiledevice
安裝libimobiledevice很簡單,在命令行輸入:bash
brew install --HEAD libimobiledevice 注意,須要加上 –HEAD 選項,若是不加,安裝是老版本,不支持iOS10的手機,因此安裝時,須要加上 –HEAD 選項
一、使用idevicesyslogapp
在命令行輸入:idevicesyslog
就能夠在屏幕上看見手機上全部的日誌了。
![](http://static.javashuo.com/static/loading.gif)
二、查看咱們想要的日誌iphone
1)將設備日誌重定向到文件
idevicesyslog >> iphone.log &
該命令是將日誌導入到iphone.log這個文件,而且是在後臺執行。
2)用tail -f和grep查看log tail -f iphone.log tail -f iphone.log | grep 'QQ' # 查看包含QQ的行
以下圖:
![](http://static.javashuo.com/static/loading.gif)
3、控制檯
在用過各類辦法查看App日誌後,仍是以爲蘋果系統自帶的工具用起來最方便,不用安裝,不用命令行,傻瓜式操做,很是方便。
ide
連上手機,在LaunchPad其餘文件中打開控制檯應用,或者搜索Console.app打開控制檯應用,能夠看到左側一欄中有咱們的手機設備,選擇就能夠,如圖:
![](http://static.javashuo.com/static/loading.gif)
右側輸出的日誌不只有咱們本身的App還有其餘進程的日誌,怎麼過濾?很是簡單,選中一條咱們的日誌,在進程名字上右鍵,選擇顯示進程名,而後就只會顯示咱們App的日誌。若是顯示的列名中沒有進程名,咱們能夠在其餘列名上右鍵,在彈出的菜單中勾選上進程就能夠了。如圖顯示WeChat打印出的日誌:
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
4、安裝第三方工具 itoos for mac /windows/linux
iPhone安裝OpenSSH和遠程鏈接教程
Building on Ubuntu 16.04
Install development packages discovered through trial and error.
sudo apt-get install automake libtool pkg-config libplist-dev libplist++-dev python-dev libssl-dev libusb-1.0-0-dev libfuse-dev
Clone and Build
Clone the sources.
cd ~/usr/src for x in libusbmuxd usbmuxd libimobiledevice ifuse; do git clone https://github.com/libimobiledevice/${x}.git;done
Now build in order (the order matters):
- libplist (not required on Ubuntu 16.04)
- libusbmuxd
- libimobiledevice
- usbmuxd
- ifuse
Note: (Optional) If you have a system package installed which is in the above list, then I recommend uninstalling it. However, if you can't uninstall it, then no big deal. It is mostly a precautionary measure. As long as you set the bash environment variables properly, then your compiled version should not reference your system packages. Uninstalling any system packages is by no means required.
Note 2: Removing usbmuxd was required on Debian Jessie 8.10 mentioned in comments.
Build libusbmuxd
cd ~/usr/src/libusbmuxd ./autogen.sh --prefix="$HOME/usr" make && make install
Build libimobiledevice
cd ~/usr/src/libimobiledevice ./autogen.sh --prefix="$HOME/usr" make && make install
Build usbmuxd
Unfortunately, sudo make install
is required because it needs to write to /lib/udev/rules.d
and /lib/systemd/system
.
cd ~/usr/src/usbmuxd ./autogen.sh --prefix="$HOME/usr" make && sudo make install
Build ifuse
cd ~/usr/src/ifuse ./autogen.sh --prefix="$HOME/usr" make && make install
Connect iPhone
Create a mount point and verify the paths of the tools before executing.
$ mkdir -p ~/usr/mnt $ type -P ifuse /home/sam/usr/bin/ifuse $ type -P idevicepair /home/sam/usr/bin/idevicepair
Now attempt to mount using ifuse.
$ idevicepair pair SUCCESS: Paired with device 37b633350ab83dc815a6a97dcd6d327b12c41968 $ ifuse ~/usr/mnt/ $ ls ~/usr/mnt/ AirFair Books CloudAssets DCIM Downloads FactoryLogs iTunes_Control MediaAnalysis PhotoData Photos PhotoStreamsData PublicStaging Purchases Radio Recordings Safari Vibrations
When you're finished. Unmount ~/usr/mnt
using fusermount
. For example,
fusermount -u ~/usr/mnt
Browsing Photos
The mounted iPhone has an empty Photos
folder. Strangely, this has no photos. Instead, look in the DCIM
folder for photos.
I have only copied photos off of my iPhone as a backup. I have not tried copying photos to my iPhone.