Adb commands

Using ADB and fastboot

What is ?

The Android Debug Bridge () is a development tool that facilitates communication between an Android device and a personal computer. This communication is most often done over a USB cable, but Wi-Fi connections are also supported.

is like a “Swiss-army knife” of Android development. It provides numerous functions that are described in detail by the command . Some of the more commonly used commands are listed in the “popular adb commands” section below.

Installing and

Google hosts zips including only and . You can set these up for use with the instructions below.

On Windows

  1. Download the Windows zip from Google.
  2. Extract it somewhere - for example,
  3. On Windows 7/8:
    • From the desktop, right-click My Computer and select Properties
    • In the System Properties window, click on the Advanced tab
    • In the Advanced section, click the Environment Variables button
    • In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button
    • Append to the end of the existing Path definition (the semi-colon separates each path entry)
  4. On Windows 10:
    • Open the Start menu, and type “advanced system settings”
    • Select “View advanced system settings”
    • Click on the Advanced tab
    • Open the “Environment Variables” window
    • Select the Path variable under “System Variables” and click the “Edit” button
    • Click the “New” button
    • Insert in the text field
  5. Install the universal adb driver, and reboot.

On macOS

  1. Download the macOS zip from Google.
  2. Extract it somewhere - for example, .
  3. Add the following to :
  4. Log out and back in.

On Linux

  1. Download the Linux zip from Google.
  2. Extract it somewhere - for example, .
  3. Add the following to :
  4. Log out and back in.
  5. You may also need to set up udev rules: see this repository for more info.

Setting up

To use with your device, you’ll need to enable developer options and USB debugging:

  1. Open Settings, and select “About”.
  2. Tap on “Build number” seven times.
  3. Go back, and select “Developer options”.
  4. Scroll down, and check the “Android debugging” or “USB debugging” entry under “Debugging”.
  5. Plug your device into your computer.
  6. On the computer, open up a terminal/command prompt and type .
  7. A dialog should show on your device, asking you to allow usb debugging. Check “always allow”, and choose “OK”.

Congratulations! is now ready to use with your device.

Setting up

Using (if your device supports it) should simply involve rebooting to fastboot mode. While in fastboot mode, you can type to verify that your device is being detected.

Popular commands

  • - launches a shell on the device
  • - pushes the file to
  • - pulls the file to . If isn’t specified, it will pull to the current folder.
  • - allows you to view the device log in real-time. You can use to view radio logs, and to view logs in colour
  • - installs the given .apk file to your device

Need help?

You can find assistance with LineageOS on our subreddit, or in #LineageOS on Libera.Chat.

Sours: https://wiki.lineageos.org/adb_fastboot_guide.html

adb (Android Debug Bridge) cheatsheet

Device Basics

CommandDescription
Lists connected devices
Lists connected devices and kind
Restarts adbd with root permissions
Starts the adb server
Kills the adb server
Remounts file system with read/write access
Reboots the device
Reboots the device into fastboot
Reboots the device into fastboot

can be specified after to ensure that the command will run once the device is connected.

can be used to send the commands to a specific device when multiple are connected.

Examples

Logcat

CommandDescription
Starts printing log messages to stdout
Displays current log buffer sizes
Sets the buffer size (K or M)
Clears the log buffers
Enables ALL log messages (verbose)
Dumps to specified file

Examples

File Management

CommandDescription
Copies the local to the device at remote
Copies the remote from the device to local

Examples

Remote Shell

CommandDescription
Runs the specified command on device (most unix commands work here)
Displays the current screen resolution
Sets the resolution to WxH
Lists all installed packages
Lists all installed 3rd-party packages
Starts the specified package
Sours: https://devhints.io/adb
  1. Valve index issues
  2. Thermometer pictures fever
  3. Destiny east gated community
  4. Penn torque star drag discontinued

In this article, you will find the list of all ADB and Fastboot Commands for Android devices. You can execute these commands on any computer regardless of its operating system (Windows, Mac, or Linux). The commands are universal, which means the same commands will work on any Android device, regardless of its manufacturer or device variant.

Android enthusiasts, familiar with unlocking bootloader, rooting, or installing a custom recovery on their device, must be well aware of ADB and fastboot. These are system utilities that provide backend of Android when it is connected to a computer.

ADB & Fastboot Commands

ADB or Android Debug Bridge can be used when an Android phone is connected to PC on fastboot or bootloader mode. There are some specific codes that can be executed using a computer to perform a function on Android devices. Mostly, people use fastboot to unlock the bootloader of a phone. Sometime, you may need to unbrick the device (in case of a hard brick) using fastboot.

Most of the fastboot and ADB commands produce the same results on any device regardless of the manufacturer or variant. If you are stuck somewhere, where you need fastboot / ADB command to assist, this post is for you. I have listed all the important fastboot, and ADB commands in the table given below. Codes, along with its property and functions, are also appropriately mentioned. Use Ctrl + F to find your requirement.

Pre-requisite

Before going to the fastboot & ADB commands, you need certain tools and settings to be enabled on your device as well as the computer. Otherwise, you can not make use of the fastboot or ADB commands. The tools are needed to be installed on the computer. On the other hand, the necessary settings are to be made on the phone.

Methods are the same for all Android smartphones. So, don’t worry about the OEM or variant. Consider the following checkpoints:

  1. You need to enable USB Debugging mode to connect your Android phone to computer. (Settings > About Phone > Build number > Tap it 7 times to become developer; Settings > Developer Options > USB Debugging).
  2. Download Android SDK Platform Tools (ADB & Fastboot)
  3. Mac users:Setup ADB on Mac (using Homebrew)
  4. USB Cable: Preferably, the one provided by the manufacturer.
  5. Optional:Download & Install Android USB Driver on your computer.

ADB Commands list

Here is the complete list of all the ADB commands that you can execute using the command prompt or terminal while connecting the Android device to the PC with all required settings. Perform the following if you had fulfilled the prerequisites mentioned above:

Displays the help documentation on ADB commands
List of all Android devices that are correctly connected to the PC via ADB
ADB devices
It will show you all the connected Android device or Emulators connected to your PC using USB
Restart your Android to system
Reboot your device into fastboot or bootloader mode
Get your Android into recovery mode
Used to manually install OTA updates using recovery mode (when the ZIP file is on the computer, not in mobile). Read more about it here!
Install APK files manually on your Android using ADB
Install APK (replacing the file name with the particular APK file name)
Re-install or update an APK to a newer version on Android using ADB
Install APK in the external SD Card (if supported by the application)
Uninstall any app using ADB command (see next)
Uninstall PUBG app package (replace package name with your desired one)
Uninstall the app keeping the data and cache untouched
Full list of JDWP (Java Debug Wire Protocol) processes on the Android
Check then the dumpsys, dumpstate and logcat data
Display full log data on the screen
It displays the ADB instance serial number string associated with the device
It is used to program the device to wait for some time until another process is done
Shows the device status in the command prompt or terminal
Starts the ADB server process
Terminate the ADB server process
Using this command, you can create a full backup of your Android device and save it to the computer
Use this command to restore the backup
Using this command, you can connect the IP address of your Android device to the computer. Remember to change the IP address in the code.

Push and Pull files using ADB

Push and pulls are used to transfer any files from the device to the computer or vice versa. To pull a file from the Android device to the computer, you need to provide the full path of the file. You can use the following ADB command:

You need to change the file name with an extension. For example, we are pulling a file called “CartoonHD.apk“. You need to execute the command in the following way:

On the other hand, while pushing files from computer to Android using ADB, you can execute the following command:

Same as before, you need to provide the full path with extension and the destination path as well. Check out the example below:

ADB Shell Commands list

Here is the complete list of all the ADB Shell commands that you can execute using the command prompt or terminal while connecting the Android device to the PC with all required settings.

ADB Shell CommandsFunctions
Starts the remote shell command console in the device and lets you control the Android through it
Use it to change the pixel density of your Android device (details given below)
Shows all the installed apps package name on your Android
Shows the list of all the system apps installed on your Android with the package name
List of all the 3rd party apps installed on your Android
Disabled apps list on your Android
Enabled (active) apps list on your Android with package names
List of all the apps that you uninstalled from your Android with installed pages

Hit enter and execute the following:
These commands change the directory to /system

Hit enter and execute the following:
Delete a file: replace whatsapp.apk to your desired file name with extension

Hit enter and execute the following:
Delate a folder: replace DCIM to your desired folder name

Hit enter and execute the following:
Create a new folder “Folder1” under /sdcard

Hit enter and execute the following:
Check the network statics on your Android device using ADB

Hit enter and execute the following:
Shows the device’s Wi-Fi IP address
Hit enter and execute the following:
Use this Coe to monitor the running CPU process on your Android device
Hit enter and execute the following:
Get the property of Android’s build.prop configuration
Hit enter and execute the following:
Use to set the values of built.prop configuration and change the properties

Uninstall a system app using ADB

If you want to uninstall a system app via ADB Shell command, you can execute the following code:

Replace with the actual package name that you want to uninstall from your Android system. This method is the easiest way to uninstall bloatware which comes inbuilt with the system that can not be uninstalled generally from the app menu. For example, if Facebook comes as a system app, and you want to remove it, execute the code in the following way:

ADB Shell dumpsys command

Using the dumpsys command, you can gather all the system data about your device’s hardware and software configuration. You can also use it to get information about your Android device’s specific elements, such as the battery, display, and battery stats.

Changing the Pixel density using ADB Shell

You can easily change the Pixel density of your Android device’s screen using commands. In order to do that, you need to know the actual Pixel density of your device. Let’s take an example with the Galaxy S9 Plus. At first, you need to know the original resolution executing the adb shell dumpsys command.

Following are the info about phone’s display, resolution, and density for Galaxy S9 Plus (after executing ):

If you want to set a lower resolution, you can check out the following examples (remember, the values may vary from device to device):

for 1080p (FHD)

for 720p (HD)

Depending on your device, you can set the values, whichever looks excellent for you.

ADB Shell command to Send SMS screen

With this ADB command, you can send a text message from your Android phone while connected to the computer:

ADB Shell for screenshots

Using this code, you can capture a screenshot on your Android phone and pull the snapped screen to your computer instantly:

Hit enter, and then:

Screen recording on Android using ADB Shell command

Android 4.4 Kitkat and above have a shell utility to record the screen and pull the video to the computer. Execute the following commands:

(Press Ctrl+C or Command+C to stop the recording)

By default, the screen recording is limited to 3 minutes only. If you want to set a condition like clip duration, resolution in pixels, and video bitrate, you can use the following commands:

I used a 1920x1080p resolution here for an example. You can change the value according to your needs.

Next, use the following command to set the video duration:

Similarly, you can also set the bitrate of the video output. For example, I am setting the bitrate to 4MBPS. The code would be as follows:

ADB Shell commands for copy, move & paste

Execute the following command to copy and paste files/folders:

and then enter the following:

(Replace the source file and destination value as per your requirements.)

Next, to move a file or a folder from one location to another, you can execute the following:

(Replace the source file and destination value as per your requirements.)

To move a file from one location to another with a new name, use the following:

ADB Shell KeyEvent commands (for advance users)

Using the Shell KeyEvent commands, you can trigger certain functions perform by hardware buttons and UI options on your Android device. Execute these codes only if you know about tweaking VM heap to improve performance.

Fastboot Commands list

Here is the complete list of all the fastboot commands that you can execute using the command prompt or terminal while connecting the Android device to the PC with all required settings. Perform the following if you had fulfilled the prerequisites mentioned above:

Fastboot commandsFunctions
Executing this command will show you the list of Android devices connected to the PC on Fastboot Mode.
Fastboot device
With this code, you can unlock the Bootloader of your Android device (if OEM permits). There is a detailed guide for MediaTek users on our site: check out here! Or Browse bootloader unlocking guide for your device here!
Relock the bootloader if you want to go back to stock position on your Android device
Reboot the device into Fastboot Mode again from the Fastboot Mode itself. (necessary sometimes while flashing some image files)
Mi Fastboot
This is the most important command for Android enthusiasts. Using this command, you can flash anything to your Android, like an OTA ZIP or a TWRP Image.
Use to flash boot image on your Android. For example: flashing a Magisk Patched Boot image to root your phone.
Fastboot reboot
Use to flash recovery images like TWRP on Android devices. Read more about flashing TWRP recovery here!
This command is used to boot your device using a particular image file without flashing it. This can be useful for testing purposes before a permanent flash. Read mode!

Anything left?

So, that’s pretty much on our blog for fastboot, and ADB commands. If I missed anything, please do let me know in the comment section below. I hope this post is helpful for you to perform a plethora of commands using cmd or terminal. If you have any questions about ADB or fastboot controls, do let me know by dropping a comment below. I will reply you back as soon as possible.

Like this post? Please do share the post link on social media to thank me 🙂

Sours: https://droidfeats.com/adb-fastboot-commands/

ADB or Android Debug Bridge is a command-line tool developed to facilitate communication between a computer and a connected emulator or Android device. Using ADB and ADB Shell commands, we can perform various actions on a device. In order that you can execute ADB and Fastboot commands, the Android SDK Platform-tools package must be installed on your Windows, Linux, or macOS computer. In this article, we’ll explore a huge list of ADB Shell commands list with a cheat sheet.

Don’t forget to check out the detailed list of ADB commands explaining the function of each of them.

What is ADB Shell?

ADB commands can be used to debug Android devices, installing or uninstalling apps, and getting information about a connected device. ADB works with the aid of three components called Client, Daemon, and Server. If you are curious about how these 3 components work together to make ADB and ADB shell commands functions, see below:

  • Client: It’s is very computer on which you use a command-line terminal to issue an ADB command. which sends commands.
  • Daemon: Or, ADBD is a background process that runs on both the connected devices. It’s responsible for running commands on a connected emulator or Android device.
  • Server: It runs in the background and works as a bridge between the Client and the Daemon and manages the communication. which manages communication between the client and the daemon.

ADB Shell commands provide access to a Unix Shell that runs a command directly on your Android device. As soon as you execute an ‘adb shell’ command on the command terminal, it sends a signal to your Android device and triggers the remote shell command console. Thus ADB shell commands let you control your Android device.

Using ADB commands, you can reboot your device, push and pull files, create a backup and restore it, sideload an update zip package, or an APK. ADB Shell commands, however, work on a much deeper level. They can be used to change the resolution of your device display, uninstall bloatware or system apps, enable and disable features, modify the system files, and change their configuration directly using commands from your computer.

Actually, there are more tasks you can perform using these commands, and below we’ll check them all with examples. Please note that there are three prerequisites before you can make use of ADB, Fastboot, and ADB shell commands.

Now you can use Web ADB in a web browser window to run ADB commands on an Android device or computer without installing ADB and Fastboot tools and USB drivers.

Finally, without any further ado, let’s proceed with our list of ADB Shell commands.

Warning: Don’t use the commands mentioned on this page unless you know how to use them and have some prior knowledge or experience.

ADB Shell Commands List & Cheat Sheet

In this ADB shell commands cheat sheet, I’ll try to explain the function of all commands in simple language.

adb shell

This command activates the remote shell command console on the connected Android smartphone or tablet.

adb shell pm uninstall

This is really a very useful ADB Shell command. Using this, you can easily uninstall the unwanted system apps. To be able to execute it, you must issue ‘adb shell‘ command first. You can then use  or followed by the Android app package name as shown below.

pm uninstall -k --user 0 com.facebook.appmanager

: Keep the app data and cache after package removal. If you want the app data to be cleared as well, use the following

pm uninstall --user0com.android.chrome

If you don’t know the app package name for the apps you want to remove, you can use to find it.

This command can help you if you want to remove all bloatware from your Android phone. Please note that most system apps don’t have the ‘Uninstall‘ option on the device but this command works magically.

adb shell cmd package install-existing

Using the above command, you can re-install an uninstalled system app.

cmd package install-existing com.facebook.appmanager

adb shell pm disable-user —user0

If you want to disable a system app on your Android device, you can execute the above command followed by the app package name

pm disable-user --user 0 com.google.ar.core

adb shell pm clear –user 0

Using this command, you can delete all data associated with an app.

adb shell pm clear –user 0 com.facebook.appmanager

adb shell pm hide –user 0

In case you want to hide an installed app on your Android device, you can execute this command line followed by the app package name.

adb shell pm hide --user 0 com.whatsapp

adb shell pm list packages

Using the above ADB Shell command, you can print the list of the app package names for all apps installed on your Android device. You can use this command with different parameters to get a more specific list of app packages.

For instance, if you want to list the system apps only, use

adb shell pm list packages -s

In order to list all third-party apps installed on your Android phone or tablet, you issue the following command.

adb shell pm list packages -3

Do you want ADB Shell to show the list of all enabled or disabled apps on your device, try the command with parameters like ‘-d‘ (for disabled apps), ‘-e‘ (for enabled apps), and ‘-u‘ (for uninstalled apps).

adb shell pm list packages -dadb shell pm list packages -eadb shell pm list packages -u

To list app packages with specific keywords filter.

adb shell pm list packages <keywords>

To find the list of apps along with their associated packages, execute the following command

adb shell pm list packages -f

You can easily get a list of group packages by a certain manufacturer, or come common term. For instance, if you want to list all apps by Google, you can use the following command.

adb shell pm list packages | grep 'google'

You can replace “google” with “samsung”, “huawei”, “xiaomi”, “miui”, “evenwell”, “android”, “facebook”, etc. to get desired list of packages.

adb shell pm path <package-name>

This command displays the APK path on the device’s file system.

adb shell pm create-user

You can use this command to create a new user on your Android device.

adb shell pm create-user username

adb shell pm remove-user

Just in case you want to remove a user from your device, you can use the above command with followed by the as shown below.

adb shell pm remove-user user 1

adb shell pm get-max-users

By using this command, you can print the maximum number of users supported on an Android device.

adb shell pm list features

Use the above command to print all supported features of the system.

adb shell pm list permissions

This command prints the list of all known permissions, optionally only those in . You can use it with the following parameters.

  • : Organize permissions by group
  • : Print all information
  • : Short summary of permissions
  • : List dangerous permissions only
  • : List the permissions seen by users only
adb shell pm list permissions -d group

adb shell settings

You can use this command to get information about certain settings on your Android device. By adding different parameters, you can find out the Android settings provider, current system volume level, notification sound, device ID, Bluetooth MAC address, current mobile data status, current WiFi status, etc.

  • adb shell settings list system
  • adb shell settings get system volume_system
  • adb shell settings get system notification_sound
  • adb shell settings list secure
  • adb shell settings get secure android_id
  • adb shell settings get secure bluetooth_address
  • adb shell settings list global
  • adb shell settings get global mobile_data
  • adb shell settings get global wifi_on

adb shell dumpsys

It’s a very flexible command that can be used standalone or with various parameters to get data related to battery, display, CPU, RAM, storage, etc. The execution of this command will give you detailed information about the Android device’s software and hardware configuration.

Note: In order to use this tool don’t forget to add permission into your Android manifest automatically

adb shell dumpsys

Other variations of the command are as follows:

  • adb shell dumpsys input
  • adb shell dumpsys display
  • adb shell dumpsys battery
  • adb shell dumpsys batterystats
  • adb shell dumpsys activity
  • adb shell dumpsys cpuinfo
  • adb shell dumpsys battery

Executing the ‘adb shell dumpsys cpuinfo‘ command, for instance, will print a list of CPU usage by the running processes and apps on your Android device as shown below:

PS C:\Users\Technastic\Desktop> adb devices List of devices attached RZ8M810BARJ device PS C:\Users\Technastic\Desktop> adb shell dumpsys cpuinfo Load: 12.48 / 12.76 / 12.82 CPU usage from 138400ms to 89027ms ago: 8.1% 5954/system_server: 5.5% user + 2.5% kernel / faults: 9802 minor 5 major 3.1% 6485/com.android.phone: 2.2% user + 0.9% kernel / faults: 6575 minor 1 major 2.7% 6596/com.android.systemui: 2.1% user + 0.6% kernel / faults: 3178 minor 1 major 2.6% 26484/com.netflix.mediaclient: 1.3% user + 1.3% kernel / faults: 109 minor 2% 2231/sugov:0: 0% user + 2% kernel 1% 24100/kworker/u18:2: 0% user + 1% kernel 1% 5706/statsd: 0.9% user + 0.1% kernel 0.5% 3752/ueventd: 0.4% user + 0.1% kernel / faults: 25 minor 0.5% 5721/rild: 0.3% user + 0.2% kernel / faults: 20 minor 0.5% 5169/logd: 0.3% user + 0.2% kernel / faults: 43 minor 0.5% 5558/surfaceflinger: 0.3% user + 0.2% kernel / faults: 1 minor 0.4% 5170/servicemanager: 0.2% user + 0.2% kernel 0.4% 1/init: 0.3% user + 0% kernel 0.4% 19725/kworker/u17:3: 0% user + 0.4% kernel 0.3% 5546/lmkd: 0% user + 0.3% kernel 0.3% 5456/kworker/u17:1: 0% user + 0.3% kernel 0.3% 5715/argosd: 0.1% user + 0.1% kernel 0.3% 2233/sugov:4: 0% user + 0.3% kernel 0.2% 23487/kworker/u18:0: 0% user + 0.2% kernel 0.1% 23896/kworker/u16:3: 0% user + 0.1% kernel / faults: 6 minor 0.1% 8/rcu_preempt: 0% user + 0.1% kernel 0.1% 5718/lhd: 0% user + 0.1% kernel 0.1% 23489/kworker/0:2: 0% user + 0.1% kernel

adb shell wm density

The above command can be used to find out the pixel density of your Android device’s display.

adb shell dumpsys window displays

You’ll get a very detailed output on the command window with info like pixel resolution, FPS, and DPI of your phone’s display.

Display: mDisplayId=0 init=1440x3040 560dpi base=1080x2280 420dpi cur=1080x2280 app=1080x2069 rng=1080x1017-2069x2069 deferred=false mLayoutNeeded=false mTouchExcludeRegion=SkRegion((0,0,1080,2280)) mDisplayInfo=DisplayInfo{"Built-in Screen, displayId 0", uniqueId "local:0", app 1080 x 2069, real 1080 x 2280, largest app 2069 x 2069, smallest app 1080 x 1017, mode 1, defaultMode 1, modes [{id=1, width=1440, height=3040, fps=60.000004}

adb shell wm size

You can find out the display resolution of your phone with this command.

PS C:\Users\Technastic\Desktop> adb shell wm size Physical size: 1440x3040 Override size: 1080x2280

If you want to modify the screen resolution and the pixel density of your Android’s display. If you’re not sure about your device’s display resolution, execute the command given below. Suppose your phone’s display resolution is QHD+, you can easily change it to Full HD+ or HD+.

adb shell wm size 1080x2220adb shell wm density 420adb shell wm size 720x1560adb shell wm density 360

ADB Shell command to Send SMS screen

If you want to send a text message using a command, try the following code.

adb shell am start -a android.intent.action.SENDTO -d sms:+918052000222 --es sms_body "Test --ez exit_on_sent false

adb shell screencap

By using this command, you can capture a screenshot and download it to your computer using the ‘adb pull’ command as described above.

adb shell screencap /sdcard/screenshot-01.png

adb shell screenrecord

On Android devices running Android 4.4 KitKat and above, you can even record your phone or tablet’s screen and download the recorded video to your computer. Besides, you can also set conditions like video duration, resolution in pixels and video bitrate, etc.

adb shell screenrecord /sdcard/screenrecord-01.mp4adb pull screenrecord /sdcard/screenrecord.mp4

You can stop screen recording using Ctrl+C. In case you want to record the screen in a specific resolution, the following command lets you set custom width and height in pixels.

adb shell screenrecord --size 1920x1080 /sdcard/screenrecord-01.mp4

By default, Android’s screen recorder’s duration is set to 180 seconds (3 minutes). You can decrease this time limit according to your needs (180 seconds is the maximum limit).

adb shell screenrecord --time-limit 120 /sdcard/screenrecord-01.mp4

Similarly, you can also determine the bitrate of the video output. To set the bitrate to 4MBPS, for example, you can use the following value:

adb shell screenrecord --bit-rate 6000000 /sdcard/screenrecord-01.mp4

adb shell getprop & adb shell setprop

The ‘getprop‘ and ‘setprop‘ commands can be used to view and set or change the configuration of the ‘build.prop’ file on Android devices. The following command, for example, displays the Android system properties information.

adb shell getprop

Below are some more examples:

getprop ro.build.version.sdkgetprop ro.chipname

In case you want to change the value of an entry in the build.prop, you can use the ‘adb shell setprop‘ commands. See the examples below:

getprop net.dns1 1.2.3.4setprop net.dns1 1.3.4.5getprop net.dns2 1.1.2.3setprop net.dns2 1.2.3.4

In the same way, if you want to change the configuration of the VMHeap size on your Android device, you can use the following command.

setprop dalvik.vm.heapsize 60m

There are some more variations of the ‘adb shell getprop‘ command that let you see information about Android system properties, SDK API level, Android security patch version, Soc, Android version, device model, device manufacturer, ADB serial number, OEM unlock status, Android device build fingerprint, WiFi MAC address, etc.

  • adb shell getprop
  • adb shell getprop ro.build.version.sdk
  • adb shell getprop ro.build.version.security_patch
  • adb shell getprop ro.board.platform
  • adb shell getprop ro.build.version.release
  • adb shell getprop ro.vendor.product.model
  • adb shell getprop ro.product.manufacturer
  • adb shell getprop ro.serialno
  • adb shell getprop ro.oem_unlock_supported
  • adb shell getprop ro.bootimage.build.fingerprint
  • adb shell getprop ro.boot.wifimacaddr

adb -s shell getprop

If you want to check the full configuration, running services and information about your Android phone or tablet, you can use the above command. First off, run the command and copy the alpha-numeric value of your device ID from the output.

PS C:\Users\Technastic\Desktop> adb devices List of devices attached RZ8M810BARJ device

Then execute the following command. Don’t forget to replace the device ID highlighted in blue with the ID of your device.

adb -s RZ8M810BARJ shell getprop

adb shell cat /proc/cpuinfo

Use the above command to get complete information about the CPU on your phone or tablet.

Get an Android device properties

By running the following command, you can see the system properties.

adb shell getprop | grep -e 'model' -e 'version.sdk' -e 'manufacturer' -e 'hardware' -e 'platform' -e 'revision' -e 'serialno' -e 'product.name' -e 'brand'

adb shell cd

Change ADB shell directory using ‘cd <directory>

adb shell

Then execute the following command:

cd /system

adb shell rm

This command lets you easily delete a file or folder from your Android device’s storage. Launch the command window, execute the ‘adb shell’ command and then try the following command with ‘-f‘ (to delete a file) and ‘-d‘ (to remove a directory) parameters.

rm -f /sdcard/com.whatsapp.apkrm -d /sdcard/WhatsApp

Note: Instead of ‘rm-d‘, you can also use ‘rmdir‘.

adb shell mkdir

Besides deleting an existing directory or folder, ADB Shell also lets you create a new directory or sub-directory. Not just that, you can set permissions for the newly created folder.

mkdir /sdcard/NewFolder mkdir -p /sdcard/NewFolder/NewFolder1 mkdir -m 644 /sdcard/NewFolder

adb shell cp

cp‘ stands for ‘copy’. You can use this command to copy files and directories located on your Android device. Again, you need to start with the ‘adb shell‘ command first.

To copy files and then paste them, by mentioning the source and destination locations as shown below:

cp /sdcard/OPWallpaperResources.apk /sdcard/DCIM/Camera

adb shell mv

mv‘ stands for ‘move’. This command can be used to move a file stored on your device from a source location to a destination location.

mv /sdcard/livewallpapers.apk /system/app

The following command will allow you to move a file with a new name.

mv /sdcard/livewallpapers.apk /sdcard/Wallpapers

adb shell top

To display the list of top CPU processes on an Android phone or tablet, you can use the above command. CPU processes monitor can be stopped using Ctrl+C.

adb shell ip

Find out the WiFi IP address of the of an Android phone or tablet.

ip -f inet addr show wlan0

adb shell netstat

Displays the network statistics of Android phones.

adb shell netstat

ADB Shell KeyEvent commands

Android devices support KeyEvent commands that can let you perform certain actions that require you to press a hardware button or tap an app or UI option. You can control your Android phone or tablet device simply by using these KeyEvent commands. These commands might come in handy if the hardware keys on your device are not functioning properly due to some damage.

  • Turn Android device ON or OFF: adb shell input keyevent 2
  • Press Home button: adb shell input keyevent 3
  • Press Back button: adb shell input keyevent 4
  • Press Call button: adb shell input keyevent 5
  • End a call: adb shell input keyevent 6
  • Turn ON the camera: adb shell input keyevent 27
  • Open wen browser: adb shell input keyevent 64
  • Press the Enter key: adb shell input keyevent 66
  • Press Backspace button: adb shell input keyevent 67
  • Open Contacts app: adb shell input keyevent 207
  • Decrease display brightness: adb shell input keyevent 220
  • Increase Display brightness: adb shell input keyevent 221
  • Cut text: adb shell input keyevent 277
  • Copy text: adb shell input keyevent 278
  • Paste text: adb shell input keyevent 279
  • Make the device sleep: adb shell input keyevent KEYCODE_SLEEP
  • Make device wakeup: adb shell input keyevent KEYCODE_WAKEUP
  • Toggle Power menu: (adb shell) input keyevent KEYCODE_POWER

You can learn more about KeyEvent commands on the Google developers portal.

Finally, it’s time to wrap up the ADB shell commands cheat sheet. In case you need this ADB shell commands list directory for future reference, you can download this PDF file.

Read Next: How to Check Android Device Activation Date

ADB and Fastboot

Sours: https://technastic.com/adb-shell-commands-list/

Commands adb

ADB Command Support

This post discusses how to use the Android Debugging Bridge (ADB) command line tool with Eggplant Functional to communicate with an Android device.

Note: You can now use the ADBCall() function for communicating with Android devices, so the method presented here is no longer required. However, we leave this article as a scripting example.

ADB is a command line tool that lets you communicate with an Android device that is connected over USB, or with an emulator. It allows you to pull data from the device such as application log files, memory usage data, and push and pull applications. This is very useful when doing regression testing, as you can automate the whole process, from pulling the old application from the device to pushing a new application onto the device, and then testing the application itself.

The only SenseTalk you need to use in Eggplant Functional to do this is the Shell() function, which allows you to initiate a command line call on your Eggplant Functional machine.

Downloads Required

Step by Step: Set-up Instructions

  1. Download and install the Android SDK on your Eggplant Functional machine here.
  2. Connect the device to your Eggplant Functional machine via USB.
  3. Create a script in your suite called "adb", and save the below code in that script:

    For Mac:

    paramsMyCommand

    putshell("cd /Users/MaxGerrard/Documents/adb/adt-bundle-mac-x86_64-20130729/platform-tools", "./adb"&&MyCommand)//Change the cd command to the path of your platform-tools folder.

    For Windows:

    paramsMyCommand

    shell"c:\windows\system32\cmd.exe", <</c "C:\Program Files (x86)\adt-bundle-windows-x86_64-20130522\sdk\platform-tools\adb" >>&&MyCommand&&"> adbexperiment.txt"

    shell"c:\windows\system32\cmd.exe", <</c "C:\Program Files (x86)\adt-bundle-windows-x86_64\sdk\platform-tools\adb" >>&&MyCommand&&"> someFile.txt"//Change the cd command to the path of your platform-tools folder.

    put file "C:\wherever\someFile.txt"

  4. Running an ADB command on the device is as simple as running an ADB command in your script. You simply pass in any ADB command you want to run, as shown below:

    adb"devices"//Find out what devices are connected

    adb"shell dumpsys meminfo -a"//Output the memory information of the device.

Further Resources

 

This topic was last updated on August 19, 2021, at 03:30:51 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2021Eggplant

Search

Sours: http://docs.eggplantsoftware.com/ePF/using/epf-adb-command-support.htm

.

Similar news:

.



128 129 130 131 132