What is Libimobile? It's a library to communicate with services of Apple iOS devices using native protocols. I find this tool especially helpful in QA to help hunt for bugs and allows me to pull crashlogs and device info quickly. If you have used ADB logcat for tailing Android logs then this will look very familiar. Below are my installation instructions on how to install and run on Mac.
All source and credits are here: https://github.com/libimobiledevice/libimobiledevice
1. Launch the terminal and enter the following commands to install:
2. Install Homebrew to help you install the necessary tools and libraries:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- You should start seeing the 🍺 during the installation
3. Install ideviceinstaller to interact with iOS devices like install, uninstall, archive, restore, etc.
brew install ideviceinstaller
4. Install these tools if you do not have them already
brew install automake
brew install libtool
5. Install libimobiledevice. This is the main tool we will be using for testing iOS.
brew install libimobiledevice --HEAD
- If you get an error such as "Error: You must `brew link libusb` before libimobiledevice can be installed" Please run:
brew link --overwrite libsub
- Then re-enter brew install libimobiledevice --HEAD
Verify Tool is Working
1. Continue working in the terminal or launch a new session
2. Plug your iOS device to your computer
3. Enter the following in the terminal:
- Your device will request confirmation to Trust your Mac. - Select Trust
- Run idevicepair pair again
- You should see something like this:
blee@blee-m01:~$ idevicepair pair SUCCESS: Paired with device
4. Check that you can pull your device information
- You should see something like below:
1. The main command you will use is idevicesyslog which will print out the device logs. You can also grep for keywords like "yourAppName".
idevicesyslog | grep "yourAppName"
2. To stop press CTRL+C
3. List of commands can be found here: https://github.com/libimobiledevice/libimobiledevice/tree/master/tools
- List of commands you may use more frequently. See Help for the necessary flags
Let me know what you think about this tool or if you have any hiccups on the installation process. Thanks!