Using ADB with your Sabre Board

Document created by SergioSolis Employee on Oct 8, 2014Last modified by SergioSolis Employee on Oct 18, 2014
Version 4Show Document
  • View in full screen mode

ADB is very well known as the tool to manually install APK’s, but there are some other useful commands.

ADB is a command line tool that acts as the bridge between you and your android device. I want to show you some of them, but first, let’s make sure we have everything needed to use ADB.

 

Requirements

 

First, you need to have Java and the Android SDK installed on your PC, you can download it from here:

 

Java SDK: Java SE - Downloads | Oracle Technology Network | Oracle

Android SDK: http://developer.android.com/sdk/index.html

 

Once it is installed, it is recommended to update the SDK Manager

sdk.png

sdkinstlaled.png

 

Once you have done this, flash the Freescale Android BSP onto your board…

 

 

Once you have installed it, you need to enable USB Debugging in the Developer Options of your board.

 

       Here's the steps to enable USB debugging:

    • Go to Settings.
    • Click on "about tablet"
    • Scroll down to the last row (Build Number) and tap that row 7 times.
    • Return to the previous screen and click on "developer options"
    • Confirm that "usb debugging" is checked.

 

Once you enable it, your OS (assuming you are using Windows) will look for the Android ADB Interface driver. Windows systems are the only ones that need this ADB driver.

 

After this procedure, you can now start using ADB.

Open a terminal window and go to the platform-tools directory of your SDK installation to find the ADB program.

The usual path to find it would be:

 

adt-bundle-windows-x86 >> sdk >>platform-tools


adb start-server                             

::  Starts the ADB server in case it is not running already

start.png

adb kill-server                  

:: Terminates de ADB server


adb devices                       

:: Checks  and prints the status of each device plugged to your PC  (If you don’t see your device, make sure USB debugging is enabled in your tablet.)

devices.png

adb install  'apk file'      

:: It will install an apk to the tablet.   This apk must be located in the same folder where the adb is.

hello.png

adb uninstall 'apk file'

:: It will uninstall an apk


adb pull 'file'                                              

:: It copies a file or directory (and sub-directories) from your device to the PC.

pull.png

adb push 'file'                         

:: It copies a file of directory (and sub-directories) from your PC to the device.

 

adb logcat                       

:: Prints the logdata to the screen

 

adb logcat –c                 

:: Clears the buffer to remove any old log data.

 

adb bugreport              

:: Prints dumpsys, dumpstate and logcat.

 

adb shell pm list packages –f   

::  List all installed packages

list.png

adb shell input keyevent 26    

:: Send the power button event to turn on/off the device

 

adb shell screencap –p /sdcard/screen.png     

:: Takes a screenshot of the android display

 

adb shell screenrecord /sdcard/demo.mp4     

:: Records any activity on the android display

 

Using the window manager


There is also a very useful tool to manage the display. This can be ran through a terminal connection to your board.

You run this command from the following path /system/bin of your android BSP

These are some of the commands available:

 

wm density 'density number'             

:: Changes the display density

desnity.png

wm size 'display size'                               

:: Changes your display’s resolution

size.png

 

Using the activity manager


In the same path is the activity manager which has several other commands for use:

 

am start 'package'  

:: Starts an activity

 

am monitor                    

:: Monitors activities

 

am bug-report              

:: Requests a bug report

 

am restart                       

:: Restarts the OS

2 people found this helpful

Attachments

    Outcomes