debug · iOS

iOS Device Debugging

There is very less information about iOS debugging. Here are some of the ways, I found to debug the iOS devices.Let’s get into those:

Real time logging of iOS devices:

There are lot of options do debug, I have used these three options to do that:

  1. Using libimobiledevice:
    1. brew install libimobiledevice
    2. idevice_id –list  (list available device UDIDs)
    3. idevicesyslog -u <device udid>
  2. Using iOSConsole (http://lemonjar.com/iosconsole/):
    1. Download the software from above link
    2. Install and connect it with device(it only support one connected device at a time)
  3. Using NSLogger(https://github.com/fpillet/NSLogger):
    1. Go to this location and download the launcher: https://github.com/fpillet/NSLogger/releases
    2. Just launch this desktop app
  4. Using xCode Tool:
    1. Go to Window -> Devices -> Choose device to take logs.Screen Shot 2016-03-19 at 7.59.19 PM

 

How to get the connected device information:

Run this command on Mac:

system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'
Get the bundle Id using UIAutoamtor Script:

Run Following program in UiAutomator using instruments(xCode) in MAC:

var target = UIATarget.localTarget(); var app_name = target.frontMostApp().bundleID(); UIALogger.logDebug(app_name);

Find Crash Log in iOS:

Mac OS X:

~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>

Windows XP:

C:\Documents and Settings\<USERNAME>\Application Data\Apple Computer\Logs\CrashReporter\MobileDevice\<DEVICE_NAME>
Take ScreenShot:
  1. Open xCode and connect the iOS device.
  2. Under Window -> devices select device window(check above picture) and click take screenshot button.
  3. New Screenshot will appears on device.
Performance information of Device or application information:
If you want to check other information about the device like performance data, memory information, network information, you can use Instrument for that.
  • Open xCode
  • Go to XCode -> Open Developer Tool -> Instrument
  • Select any of the option which you would like to track.
  • Select App and you can get any kind of device information in graphs or console.

Here is the screenshot of Instruments:

Screen Shot 2016-03-19 at 8.07.04 PM

Let me know, if you know any other tool to debug the iOS devices or any other options, please mention your tool below.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s