Shake before serving, Refrigerate after opening...
Benjamin Lee
  • Blog
  • About
  • Contact

IOS TESTING TOOL: LIBIMOBILEDEVICE

11/15/2016

1 Comment

 
EDIT: updated instruction for "idevicepair" 
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

Install Instructions
1. Launch the terminal and enter the following commands to install:
xcode-select --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:
idevicepair pair
  - 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 
b72bf3e9d4df528c31db6b356a6d6fd5557222bb

4. Check that you can pull your device information
ideviceinfo
  
- You should see something like below:
blee@blee-m01:~$ ideviceinfo
ActivationState: Activated
ActivationStateAcknowledged: true
BasebandActivationTicketVersion: V2
BasebandCertId: 3840149528
BasebandChipID: 8343777
BasebandKeyHashInformation:
AKeyStatus: 2
SKeyHash: u+/tcCwvaQ+1Y9t40I4yegCEmB28mALlaROhaIVGBWo=
SKeyStatus: 0 


Start Tailing!
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
**OR**
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
idevicesyslog
idevicecrashreport
ideviceinfo
idevice_id
idevicerepair


Let me know what you think about this tool or if you have any hiccups on the installation process. Thanks!
1 Comment

qa tools - Video capture on ios and android devices

3/8/2016

1 Comment

 
When performing blackbox testing on mobile devices, it can be difficult describing the issues you come across to developers. This is where screenshots and video recordings can help convey that message more clearly. Sometimes a bug happens so quickly a screenshot can be difficult to time in order to capture the error. There are other services and apps out there that help you accomplish this, but below are instructions on how you can do this with existing tools you may already have - so let's review how we can do video recordings on iOS and Android (via Mac)! 

iOS
  1. Be sure you are running Yosemite or later (10.10) and update Quicktime Player
  2. Plug in your trusted iOS device to your Mac
  3. Open up Quicktime Player and start a new movie recording (COMMAND + OPTION + N)
  4. Click on the drop down menu next to the recording button and select your iOS device (iPhone, iPad, iPod Touch)
  5. Click on the Record button when you are ready
  6. Click on the Stop when you are complete - don't forget to save the file.

Anddddd done! You have now recorded the actions made on your iOS device! A quick note - this will work for devices on iOS 8 or higher.

Android
  1. Be sure to set your .bash_profile with the paths to your android sdk tools
    1. Leave a comment if you aren't sure how to do this!
  2. Plug in your trusted Android device to your Mac and be sure the device has USB Debugging enabled
    1. Usually found in Settings > General > Developer Options
  3. Open your terminal
  4. Type: adb shell screenrecord /sdcard/test.mp4
  5. Press CTRL + C to stop recording
    1. Your video is now saved in /sdcard/test.mp4 on the device
    2. If you are getting an error this means you may not have set up your .bash_profile correctly
  6. Type: adb pull /sdcard/test.mp4 ~/Desktop
    1. This will pull the video from the sdcard to your Desktop.
  7. [Optional]
    1. Type: adb shell rm -r /sdcard/test.mp4
      1. ​This will remove the file from your device so you won't have too many videos hogging your memory
    2. Type: adb shell --bit-rate 6000000 /sdcard/test.mp4
      1. ​This will set your video quality to record at 6 Mpbs.
      2. Default quality is 4 Mbps
Boom! You have now recorded your actions from the physical device through the Terminal. 

This will hopefully save you a significant amount of time on how you used to make recordings and help you convey your bugs better to developers! Let me know what you think! 
1 Comment

    Author

    Hey there - my name is Ben and these are the snapshots of my memory dump.

    Archives

    February 2019
    November 2018
    October 2018
    November 2016
    March 2016
    October 2015
    July 2015
    June 2015
    May 2015
    December 2014

    Categories

    All
    Android
    Career
    Ios
    Programming
    Qa
    Ramen
    Random Update

    RSS Feed