iOS如何实时查看App运行日志


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能看到手机中运行的进程输出的日志。如图:
 
image.png
 
image.png

2、libimobiledevice

安装libimobiledevice很简单,在命令行输入:bash

brew install --HEAD libimobiledevice 
注意,须要加上 –HEAD 选项,若是不加,安装是老版本,不支持iOS10的手机,因此安装时,须要加上 –HEAD 选项

一、使用idevicesyslogapp

在命令行输入:idevicesyslog

 

 

就能够在屏幕上看见手机上全部的日志了。
 
log.png

二、查看咱们想要的日志iphone

1)将设备日志重定向到文件

idevicesyslog >> iphone.log &
该命令是将日志导入到iphone.log这个文件,而且是在后台执行。

2)用tail -f和grep查看log tail -f iphone.log tail -f iphone.log | grep 'QQ' # 查看包含QQ的行 

 

 

以下图:
 
QQ.png

3、控制台

在用过各类办法查看App日志后,仍是以为苹果系统自带的工具用起来最方便,不用安装,不用命令行,傻瓜式操做,很是方便。
ide

 

连上手机,在LaunchPad其余文件中打开控制台应用,或者搜索Console.app打开控制台应用,能够看到左侧一栏中有咱们的手机设备,选择就能够,如图:
 
控制台.png

右侧输出的日志不只有咱们本身的App还有其余进程的日志,怎么过滤?很是简单,选中一条咱们的日志,在进程名字上右键,选择显示进程名,而后就只会显示咱们App的日志。若是显示的列名中没有进程名,咱们能够在其余列名上右键,在弹出的菜单中勾选上进程就能够了。如图显示WeChat打印出的日志:
 
WeChat1.png
 
WeChat2.png

 

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):

  1. libplist (not required on Ubuntu 16.04)
  2. libusbmuxd
  3. libimobiledevice
  4. usbmuxd
  5. 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.

Browsing Music

相关文章
相关标签/搜索