<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: larson</title>
    <description>The latest articles on DEV Community by larson (@larsonzhong).</description>
    <link>https://dev.to/larsonzhong</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F558349%2Fe42c8af3-ec91-4ed8-9a0e-28bad01eff03.png</url>
      <title>DEV Community: larson</title>
      <link>https://dev.to/larsonzhong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/larsonzhong"/>
    <language>en</language>
    <item>
      <title>Android Gpio use cases by controlling LED</title>
      <dc:creator>larson</dc:creator>
      <pubDate>Thu, 14 Jan 2021 09:53:02 +0000</pubDate>
      <link>https://dev.to/larsonzhong/android-gpio-use-cases-by-controlling-led-298d</link>
      <guid>https://dev.to/larsonzhong/android-gpio-use-cases-by-controlling-led-298d</guid>
      <description>&lt;p&gt;This experiment uses the GPIO port to pull up and down to control the on and off of the small lights. As a soldier who has just switched from the application layer to the framework, writing this article hopes to help you learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GPIO
&lt;/h2&gt;

&lt;p&gt;GPIO, the full English name is General-Purpose IO ports, that is, general-purpose IO ports. Embedded systems often have a large number of external devices/circuits with relatively simple structures. Some of these devices/circuits require the CPU to provide control means, and some need to be used by the CPU as an input signal. Moreover, many of these devices/circuits only require one bit, that is, as long as there are two states of on/off, such as light on and off. For the control of these devices/circuits, it is not appropriate to use traditional serial ports or parallel ports.&lt;/p&gt;

&lt;p&gt;Therefore, a "universal programmable IO interface" is generally provided on the microcontroller chip, that is, GPIO.&lt;br&gt;
In layman's terms, some pins can be used to output high and low levels or read the state of the pins through them-whether they are high or low.&lt;/p&gt;
&lt;h2&gt;
  
  
  Generate devices in the kernel
&lt;/h2&gt;
&lt;h3&gt;
  
  
  principle
&lt;/h3&gt;

&lt;p&gt;Regarding GPIO port character device driver, we have to do the following steps:&lt;br&gt;
1 Find the GPIO port corresponding to the schematic and configure it as an output pin&lt;br&gt;
GPIO port configuration (different platform configuration is different) but the purpose is the same. Set the GPIO port output, and the default low level, we are connected to 57 pins&lt;br&gt;
&amp;lt;&amp;amp;range 56 1 0x1500&amp;gt;&lt;br&gt;
&amp;lt;&amp;amp;range 57 1 0x1500&amp;gt; means 57 pins are used as gpio ports, and default low level&lt;br&gt;
This io port register address: 0xe46002e4&lt;/p&gt;

&lt;p&gt;But during the debugging process&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#define gpio_lp 57
gpio_request(gpio_lp,"pos_pwr");
gpio_set_value(gpio_lp,1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The GPIO call request reports an error, which causes the GPIO to be unusable, but after changing the GPIO port, changing the gpio port will not report the error.&lt;br&gt;
This reason is due to the particularity of intel: gpio is called in the place of vmm, and it cannot be operated under the kernel (the general platform is no problem with this operation)&lt;/p&gt;

&lt;p&gt;Later, I thought of another method&lt;/p&gt;

&lt;p&gt;void __iomem *ldo_mmio_base = ioremap(0xe46002e4, 4);&lt;br&gt;
iowrite32(0x1700, ldo_mmio_base); //1700 represents the setting register (0xe46002e4) is GPIO port, and the output is high&lt;br&gt;
iowrite32(0x1500, ldo_mmio_base);//1500 represents the setting register (0xe46002e4) is GPIO port, the output is low&lt;/p&gt;

&lt;p&gt;Realize the control of IO port&lt;/p&gt;
&lt;h3&gt;
  
  
  achieve
&lt;/h3&gt;

&lt;p&gt;I put the source code under kenel-3.10/drivers/char to let the system generate a device node: /dev/mtgpio, which needs to be modified in two places.&lt;br&gt;
First enter the kernel-3.10/drivers/char directory, add a new file, I named it lp6735_switch.c here, the specific code is as follows:&lt;br&gt;
kernel-3.10/drivers/char$ vim lp6735_switch.c&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;linux/module.h&amp;gt; /* For module specific items */
#include &amp;lt;linux/moduleparam.h&amp;gt; /* For new moduleparam's */
#include &amp;lt;linux/types.h&amp;gt; /* For standard types (like size_t) */
#include &amp;lt;linux/errno.h&amp;gt; /* For the -ENODEV/... values ​​*/
#include &amp;lt;linux/kernel.h&amp;gt; /* For printk/panic/... */
#include &amp;lt;linux/fs.h&amp;gt; /* For file operations */^M
#include &amp;lt;linux/ioport.h&amp;gt; /* For io-port access */
#include &amp;lt;linux/platform_device.h&amp;gt; /* For platform_driver framework */
#include &amp;lt;linux/init.h&amp;gt; /* For __init/__exit/... */
#include &amp;lt;linux/uaccess.h&amp;gt; /* For copy_to_user/put_user/... */
#include &amp;lt;linux/io.h&amp;gt; /* For inb/outb/... */
#include &amp;lt;linux/gpio.h&amp;gt;
#include &amp;lt;linux/device.h&amp;gt;
#include &amp;lt;linux/cdev.h&amp;gt;
#include &amp;lt;linux/slab.h&amp;gt; /*kamlloc */
//#include &amp;lt;asm-generic/ioctl.h&amp;gt;

 //ioctl
#define CMD_FLAG'i'
#define led_PWR_ON _IOR(CMD_FLAG,0x00000001,__u32)
#define led_PWR_OFF _IOR(CMD_FLAG,0x00000000,__u32)
#define gpio_lp 57

static int major =0;
static struct classclass *led_class;
struct cdev_led {
    struct cdev cdev;
};
struct cdev_led *led_dev;

static int led_ioctl(struct file* filp,unsigned int cmd,unsigned long argv)
{
    printk(KERN_INFO "entry kernel.... \n");
    printk(KERN_INFO "%d\n", led_PWR_ON);
    void __iomem *ldo_mmio_base = ioremap(0xe46002e4, 4);

    switch(cmd)
    {
        case led_PWR_ON:
        {
#if 0
            gpio_set_value(gpio_lp,1); //
            printk(KERN_INFO "led on\n");
#endif
            iowrite32(0x1700, ldo_mmio_base)
            break;
        }
        case led_PWR_OFF:
        {
#if 0
            gpio_set_value(gpio_lp,0);
            printk(KERN_INFO "led off \n");
#endif
            iowrite32(0x1500, ldo_mmio_base);
            break;
        }
        default:
            return -EINVAL;
    }
    return 0;
}


//open
static int led_open(struct inode* i_node,struct file* filp)
{
    printk(KERN_INFO "larsonzhong open init.... \n");
    int err;
// larsonzhong Content between #if 0 #endif would comment, because there is no actual device
 #if 0
    err = gpio_request(gpio_lp,"led_pwr");
    if(err&amp;lt;0)
    {
        printk(KERN_INFO "gpio request faile \n");
        return err;
    }
    gpio_direction_output(gpio_lp,1);
 #endif
    return 0;
}

//close
static void led_close(struct inode* i_node,struct file* filp)
{
printk(KERN_INFO "larsonzhong close init \n");
// larsonzhong Content between #if 0 #endif would comment, because there is no actual device
#if 0
    gpio_free(gpio_lp);
#endif
    return;
}

/* file operations */
struct file_operations fops={
    .owner = THIS_MODULE,
    .open = led_open,
    .unlocked_ioctl = led_ioctl,
    .release = led_close,
};

static int __init led_init(void)
{
    printk(KERN_INFO "init .... \n");
    dev_t dev_no;
    int result,err;
    err = alloc_chrdev_region(&amp;amp;dev_no,0,1,"my_led"); //dynamic request device number
    if(err&amp;lt;0)
    {
        printk(KERN_INFO "ERROR\n");
        return err;
    }
    major = MAJOR(dev_no);
    led_dev = kmalloc(sizeof(struct cdev_led),GFP_KERNEL);
    if(!led_dev)
    {
        result = -ENOMEM;
        goto fail_malloc;
    }
    memset(led_dev,0,sizeof(led_dev));

    cdev_init(&amp;amp;led_dev-&amp;gt;cdev,&amp;amp;fops);
    led_dev-&amp;gt;cdev.owner = THIS_MODULE;
    result = cdev_add(&amp;amp;led_dev-&amp;gt;cdev,dev_no,1);
    if(result &amp;lt;0)
    {printk(KERN_INFO "error\n");
        goto fail_add;
    }
    led_class = class_create(THIS_MODULE,"mtgpio"); //in sys/class create sysfs file
    device_create(led_class,NULL,MKDEV(major,0),NULL,"mtgpio"); //dynamic create device file /dev/myled
    return 0;
fail_add:
    kfree(led_dev);
fail_malloc:
    unregister_chrdev_region(dev_no,1);
    return result;

}

static void __exit led_exit(void)
{
    dev_t dev_no=MKDEV(major,0);

    unregister_chrdev_region(dev_no,1);
    cdev_del(&amp;amp;led_dev-&amp;gt;cdev);
    kfree(led_dev);
    device_destroy(led_class,dev_no);
    class_destroy(led_class);
    printk(KERN_INFO "exit........ \n");
}
module_init(led_init);
module_exit(led_exit);
MODULE_AUTHOR("larsonzhong@gmail.com");
MODULE_DESCRIPTION("control_led_power");
MODULE_LICENSE("GPL");

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit, and then we need to modify a file, which is the makefile in the same directory.&lt;br&gt;
Add a paragraph in kernel-3.10/drivers/char$ vim Makefile:&lt;br&gt;
+obj-y += lp6735_switch.o&lt;br&gt;
Specific code, because csd has processed some special symbols, only pictures can be uploaded:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgconvert.csdnimg.cn%2FaHR0cDovL2ltZy5ibG9nLmNzZG4ubmV0LzIwMTcwNDIxMTIxMzIyNDI5%3Fx-oss-process%3Dimage%2Fformat%2Cpng" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgconvert.csdnimg.cn%2FaHR0cDovL2ltZy5ibG9nLmNzZG4ubmV0LzIwMTcwNDIxMTIxMzIyNDI5%3Fx-oss-process%3Dimage%2Fformat%2Cpng" alt="makefile file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adding lp6735_switch.c and modifying the Makefile, the firmware generation will generate a node under /dev/ /dev/mtgpio&lt;br&gt;
To make this node readable and writable by others, you must also modify the system owner of the node and his permissions. This step is carried out in init.rc.&lt;/p&gt;

&lt;p&gt;My code is system/core/rootdir/init.rc&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ...
   # added by larsonzhong@163.com change my devices mqgpio
   chown system system /dev/mtgpio
   chmod 0766 /dev/mtgpio
   ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start experiment
&lt;/h2&gt;

&lt;p&gt;We assume that the device of the small lamp we want to use is dev/mtgpio##Jni header file&lt;br&gt;
Create a new Android project, and then create a new class, here is GpioLED.java.&lt;br&gt;
To&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class GpioLED {
To
//Control LED power on
public native static void ledPowerOn();
// Control the LED to power off
public native static void ledPowerOff();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To&lt;br&gt;
Generate header file&lt;/p&gt;

&lt;p&gt;Method 1: Simple and rude&lt;br&gt;
Use javah to generate, please note that the java environment has been set up (including environment configuration classpath configuration).&lt;br&gt;
Go to the classes directory under the bin directory under the source code, and use the javah -jni package name. Class name, here is javah -jni com.coban.ledsimple.LEDGpio&lt;br&gt;
We can see the header file in the directory and open the header file. Copy the statement inside.&lt;/p&gt;

&lt;p&gt;Method 2: More convenient&lt;br&gt;
Click the small triangle next to the compile button with toolbox next to the compile button, a drop-down list pops up, click External Tools Configurations, a dialog box pops up,&lt;br&gt;
We select Program and click the new button above. Then fill in as follows:&lt;/p&gt;

&lt;p&gt;Main card:&lt;br&gt;
Name: javah&lt;br&gt;
Location: Select the directory where javah is located. Mine is C:\Program Files\Java\jdk1.8.0_102\bin\javah.exe&lt;br&gt;
Working Diractory: Click the variables button to pop up the list, select project_loc to confirm, and then add \src at the end, my result is ${project_loc}\src&lt;br&gt;
Arguments: -classpath ${project_loc}\bin\classes -d ${project_loc}\jni -jni ${java_type_name}&lt;br&gt;
Refresh card:&lt;br&gt;
Check refresh Resource upon completion&lt;br&gt;
Common card:&lt;br&gt;
Check External Tools and click apply&lt;/p&gt;
&lt;h3&gt;
  
  
  jni implementation
&lt;/h3&gt;

&lt;p&gt;Create a new c file and mk file. If you are using eclipse and ndk is configured (note that ndk must be configured not only in eclipse, but also in environment variables) otherwise there may be Unable to launch cygpath. Is Cygwin on the path?] error.&lt;br&gt;
Right click Project-&amp;gt;Android Tools-&amp;gt;Add Native Support&lt;br&gt;
Then you will see an additional folder and two files in the project directory, we paste the header file declaration just copied.&lt;/p&gt;

&lt;p&gt;My code implementation here is like this: ledcontrol.c&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;
#include&amp;lt;fcntl.h&amp;gt;
#include&amp;lt;errno.h&amp;gt;
#include&amp;lt;unistd.h&amp;gt;
#include&amp;lt;sys/ioctl.h&amp;gt;
#include&amp;lt;jni.h&amp;gt; // Must include this file
#include&amp;lt;string.h&amp;gt;
#include&amp;lt;sys/types.h&amp;gt;
#include&amp;lt;sys/stat.h&amp;gt;
#include &amp;lt;android/log.h&amp;gt;
//Command code in the driver.
#define CMD_FLAG'i'
#define LED_ON _IOR(CMD_FLAG,0x00000001,__u32)
#define LED_OFF _IOR(CMD_FLAG,0x00000000,__u32)

#define DEVICE_NAME "/dev/mtgpio"
int fd;


static const char *TAG="012";
#define LOGI(fmt, args...) __android_log_print(ANDROID_LOG_INFO, TAG, fmt, ##args)
#define LOGD(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, TAG, fmt, ##args)
#define LOGE(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, TAG, fmt, ##args)

/* * Class: Linuxc
* Method: openled
* Signature: ()I
*/

JNIEXPORT void JNICALL Java_com_coban_ledsimple_LEDGpio_ledPowerOn(JNIEnv* env, jclass mc)
{
  LOGI("POWER ON BY LARSON");
  LOGI("LED_ON:%d LED_OFF:%d",LED_ON,LED_OFF);
  fd=open(DEVICE_NAME,O_RDWR);
  if(fd&amp;lt;0)
      {
            LOGI("don't open dev");
        }
        else
            {
            ioctl(fd,LED_ON,NULL);
            LOGI("open success");
            }


}

/* * Class: Linuxc
* Method: clsoeled
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_coban_ledsimple_LEDGpio_ledPowerOff(JNIEnv* env, jclass mc)
{
    LOGI("POWER Off BY LARSON");
    ioctl(fd,LED_OFF,NULL);
    close(fd);

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please note that I used the log and some other header files here, we need to include the relevant libraries. Modify Android.mk&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_LDLIBS := -lm -llog
LOCAL_MODULE := ledcontrol
LOCAL_SRC_FILES := ledcontrol.c

include $(BUILD_SHARED_LIBRARY)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should be noted that LOCAL_LDLIBS := -lm -llog should not be added in front of include $(CLEAR_VARS), otherwise it will be cleared and invalidated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application.mk
APP_ABI := all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The meaning here is to compile the so files of all platforms, if you want to specify a compilation&lt;br&gt;
APP_ABI := armeabi armeabi-v7a x86&lt;br&gt;
Separated by a space&lt;/p&gt;
&lt;h3&gt;
  
  
  Generate so file
&lt;/h3&gt;

&lt;p&gt;We directly push or build the software to the device. You will see an extra obj folder in the project directory,&lt;br&gt;
And there are several more folders under libs, these folders correspond to different platforms.&lt;/p&gt;
&lt;h3&gt;
  
  
  APP Implementation
&lt;/h3&gt;

&lt;p&gt;I will post the code directly here&lt;br&gt;
HelloJniLED.java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.example.hellojni;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class HelloJniLED extends Activity {
private Button power_on;
private Button power_off;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
power_on = (Button) findViewById(R.id.power_on);
power_off = (Button) findViewById(R.id.power_off);

To
power_on.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("012", "power_on by android\n");
LEDGpio.ledPowerOn();

}
});
power_off.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("012", "power_off by android\n");
LEDGpio.ledPowerOff();

}
});

}
To
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LEDGpio.java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.coban.ledsimple;

import android.util.Log;

public class LEDGpio {
static {
try {
Log.i("012", "try to load ledcontrol.so");
System.loadLibrary("ledcontrol");
} catch (UnsatisfiedLinkError ule) {
Log.e("012", "WARNING: Could not load ledcontrol.so");
}
}

public native static void ledPowerOn();

public native static void ledPowerOff();
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Layout file activity_main.xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"&amp;gt;

    &amp;lt;TextView
        android:id="@+id/position"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text=" power control "
        android:textColor="#ff0000"
        android:textSize="25sp" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/power_on"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/position"
        android:layout_centerHorizontal="true"
        android:layout_toLeftOf="@+id/position"
        android:text="power_on"
        android:textSize="18sp" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/power_off"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/position"
        android:layout_toRightOf="@+id/position"
        android:text="power_off"
        android:textSize="18sp" /&amp;gt;

&amp;lt;/RelativeLayout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>gpio</category>
      <category>android</category>
      <category>mcu</category>
    </item>
    <item>
      <title>Essential software on a new computer</title>
      <dc:creator>larson</dc:creator>
      <pubDate>Thu, 14 Jan 2021 07:12:21 +0000</pubDate>
      <link>https://dev.to/larsonzhong/essential-software-on-a-new-computer-420i</link>
      <guid>https://dev.to/larsonzhong/essential-software-on-a-new-computer-420i</guid>
      <description>&lt;p&gt;From the beginning to the present, I don’t know how many times I have installed the system, and every time I don’t remember what kind of software I need to use. Later, I started to use a network disk to download this software to a directory, but due to the software version update, I was unwilling to use the software in this directory when I installed the system next time, so this article was published.&lt;br&gt;
This article has been collected by many people, so I realized that this matter is very meaningful, so I have kept it up to date;&lt;/p&gt;
&lt;h1&gt;
  
  
  1. Office Drawing
&lt;/h1&gt;
&lt;h2&gt;
  
  
  Markdown Generate Directory
&lt;/h2&gt;

&lt;p&gt;If you get some other websites to write blogs on GitHub, it is a painful thing to ask you to organize the catalog yourself. Of course, the best way is to use tools to generate it;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GH-MD-TOC&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The artifact is to run under Linux;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gh-md-toc file.md | &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; +2 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cat &lt;/span&gt;file.md&lt;span class="o"&gt;)&lt;/span&gt; | sponge file.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will be surprised to find that this command completes everything and generates a table of file.MD&lt;br&gt;
contents are automatically added to the head of file.MD, and blank lines are handled perfectly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Markdown All in One&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a VS plug-in. After installation, click on the md file, then the shortcut key CTRL(CMD)+SHIFT+P, enter Markdown All in One: Create Table of Contents and press Enter, as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20210114110927232.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20210114110927232.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1.1 Online drawing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ProcessOn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ProcessOn is an online collaborative drawing platform that supports the online creation of flowcharts, mind maps, organizational charts, network topology diagrams, BPMN, UML diagrams, UI interface prototype design, etc., and the interface is also very simple.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413164904575.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413164904575.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MindMaster mind map&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MindMaster has a very good interface and interaction, and its functions will be much richer than the above software. It is a very professional online mind mapping tool. It can not only create topics, but also teamwork, but also customize the filling, style, effect, etc. of each topic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413164956656.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZV4ubhFF1g%2Ccolor%3Duc2FF25b16g_size%2Ccolor%3Duc2u%2Cbg9nLmNzZV4ubhV0L" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413164956656.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZV4ubhFF1g%2Ccolor%3Duc2FF25b16g_size%2Ccolor%3Duc2u%2Cbg9nLmNzZV4ubhV0L" alt="Insert image description here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typora&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was not used to it when I first started using it, because I used the Markdown Pad to write markdown files at the beginning, and there is a real-time preview function in it that I can't get rid of; &lt;a href="https://www.typora.io/" rel="noopener noreferrer"&gt;Typora&lt;/a&gt; The advertisement says yes The most concise and most beautiful editor is aimed at this conciseness, I went to understand it. It's really not bad;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200827100855201.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200827100855201.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Other editors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to Typora, there are many good editors, like Markdown Pad, like Cmd Markdown, like Atom (yes, this is a code IDE), like VS Code (this is also a code editor); but Github's syntax and Typora is consistent, so I still like Typora;&lt;/p&gt;

&lt;h2&gt;
  
  
  1.3 Take notes
&lt;/h2&gt;

&lt;p&gt;Good memory is not as good as bad writing. An efficient note-taking software can help us save a lot of time. The best note-taking application I have used is Evernote, followed by Youdao Cloud Note.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Evernote&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everyone recommends note-taking applications, both in the cloud and on the desktop. The layout is also beautiful and rich in functions. It is the first choice for writing articles, taking notes, attending classes, and other recording scenarios. If you use it, you need to go to &lt;a href="//https:%20//www.yinxiang.com/"&gt;Evernote official website&lt;/a&gt; Registration;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165132317.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165132317.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2. System Ease of Use
&lt;/h1&gt;

&lt;h2&gt;
  
  
  2.1 Clipboard
&lt;/h2&gt;

&lt;p&gt;Have you ever encountered a scene where you want to copy two paragraphs of text at the same time, but the clipboard that comes with Windows only supports one paragraph of text at the same time, Ctrl+C and then Ctrl+V;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ditto&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ditto is a standard Windows cut and paste tool. Support network synchronization, record grouping, name paste, and other functions. Small but powerful and easy to use. You can paste text, pictures, HTML, and custom formats in the clipboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415151447319.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415151447319.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2.2 Window Management
&lt;/h2&gt;

&lt;p&gt;Window’s file browser can’t intuitively switch the directories we open. When there are too many open directories, I will turn off a few of them for obsessive-compulsive disorder, but then I found that I need to re-use Ie Explorer to open that directory. There is no software that can switch the browsing window on a View like a browser manages the tab page. After all, it now supports multiple windows whether it is text editing or page browsing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;clover&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Chinese name "Four Leaf Clover", I believe many people have heard of it. It is a lightweight file management artifact and my favorite multi-tab file manager (lightweight). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165456759.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165456759.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total Commander&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is another awesome file management artifact. It is an advanced version of Clover. It has a large number of loyal users and is powerful. It is highly recommended by Geek;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165303134.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165303134.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2.3 Desktop organization
&lt;/h2&gt;

&lt;p&gt;Seeing the dense collection of desktop icons, it is painful to see if they are all left in a temporary folder and afraid of not being found. The screen is full and it affects beauty. At this time, I hope to have a partition software, so that you can quickly manage desktop affairs;&lt;/p&gt;

&lt;p&gt;I have used Tencent’s and 360’s desktop finishing software, but in the end, I still used Fence;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a lightweight desktop organization software, I like lightweight things;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165601472.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165601472.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bing Wallpapers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bing Wallpaper contains exquisite pictures from all over the world selected on the Bing homepage. Not only will you see a new image on your desktop every day, but you can also browse the image and learn its source.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200604135943126.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200604135943126.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2.4 File Search &amp;amp; Organize
&lt;/h2&gt;

&lt;p&gt;The computer has been used for a long time, it may be troublesome to find files. If you use the file browser that comes with windows, you may not find it, and the efficiency is low. Here are several tools that can quickly locate the file;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.voidtools.com/" rel="noopener noreferrer"&gt;Everything&lt;/a&gt; is a file search tool developed by void tools. The official website describes it as "Locate files and folders by name instantly".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165642470.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165642470.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;listary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Listary is smarter than Everything and more powerful to use, but because it needs to be in the background, it may conflict with other software shortcuts. In order to avoid this conflict, I finally use Everything;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165749899.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165749899.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;spacesniffer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Is your C drive running out of disk space? Try &lt;a href="https://spacesniffer.en.softonic.com/" rel="noopener noreferrer"&gt;spacesniffer&lt;/a&gt;, he can quickly scan the file composition in the C drive, and quickly find large files that can free up space.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165853149.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413165853149.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Windows/linux tools
&lt;/h1&gt;

&lt;h2&gt;
  
  
  3.1 Mirror write
&lt;/h2&gt;

&lt;p&gt;Including Linux mirroring and Windows mirroring writing. Generally speaking, we don't write much Windows mirroring. Generally, we need to write a windows image when it is used for system disks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Soft Disk Link&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://cn.ultraiso.net/" rel="noopener noreferrer"&gt;Soft Disk Link&lt;/a&gt;, UltraISO Floppy is a tool for making/editing/converting CD image files. It can edit ISO files, extract files and directories from ISO, make CD images from CD-ROM or make files on the hard disk into ISO files, and make bootable CDs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Win32 Disk Imager&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I often use it to write Linux systems, such as writing systems to the Raspberry Pi and writing systems to the router. It is very versatile, lightweight, and convenient. I like it very much.&lt;/p&gt;

&lt;h2&gt;
  
  
  3.2 Software uninstall
&lt;/h2&gt;

&lt;p&gt;In the past, I only knew that 360 can be uninstalled in batches, so every time I want to uninstall in batches, I need to install 360 Security Guard, so I was forced to install the whole family bucket. Later I found that other tools can also achieve the effect, such as Revo Uninstaller Pro;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Revo Uninstaller&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lightweight, efficient, and perfect for batch software uninstallation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413171059296.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413171059296.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.3 Remote login
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;FinalShell&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is highly recommended. I have been using this software since Xshell could not be cracked. The focus is on open source and easy to use. It comes with Ftp tools, which is great.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415145802907.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415145802907.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;remote Desktop connection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The software that comes with Windows is focused on being lightweight and efficient. Congratulations on the system that comes with it, it's much cleaner than other software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415145949405.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415145949405.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.4 Remote Assistance
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Splashtop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The software developed by foreigners is lightweight and efficient and supports Win, Mac, Linux, and other systems across platforms, and even mobile systems such as iOS and Android. Great!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415150854256.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415150854256.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sunflower&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415150105761.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415150105761.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TeamViewer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It can be used for remote control in the background of any firewall and NAT proxy. It can be used to easily connect to any PC or server in the world. There are currently about 200 million users using Teamviewer. Teamviewer is free for personal use, but annoying ads will pop up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415150204248.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415150204248.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.6 Audio and video playback
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Shark007&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a program package that enables the media player that comes with Windows to support a full range of audio and video encodings. Blessed are friends who are fed up with domestic software ads pointing to experience the pure version of local playback. Shark007 supports many encoding formats. Basically, support all mainstream formats. &lt;a href="https://www.majorgeeks.com/files/details/win7codecs.html" rel="noopener noreferrer"&gt;Official download address&lt;/a&gt; is easy to be walled, you can download it at &lt;a href="http://www.downza.cn/soft/%20198332.html" rel="noopener noreferrer"&gt;Domestic Software Download Station&lt;/a&gt; download.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170334362.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170334362.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PotPlayer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PotPlay is an independent player, but like shark007, it supports opening with the media player that comes with windows. The encoding is also very comprehensive because it is a foreign software, so &lt;a href="https://potplayer.en.softonic.com/" rel="noopener noreferrer"&gt;Official website download&lt;/a&gt; is slow, you can use Baidu's &lt;a href="https://dl%20.pconline.com.cn/download/51960-1.html" rel="noopener noreferrer"&gt;Domestic software download station&lt;/a&gt; download;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170526473.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170526473.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.7 Browser
&lt;/h2&gt;

&lt;p&gt;There are many domestic browsers, such as 360, Tencent, Do you, etc., but in the end, I think the best to use is the foreign three giants Ie, Google Chrome, Firefox, Ie have basically heard and used it, Firefox and chrome if you are Geek, you will love it;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firefox browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since &lt;a href="http://www.firefox.com.cn/" rel="noopener noreferrer"&gt;Firefox official website&lt;/a&gt; is not walled, you can click the link to download the latest version. Windows, Linux, and macOS are all supported; you may think she is not good-looking, but her Memory optimization is great;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170545380.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170545380.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chrome browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The browser developed by Google is ranked first in the world and the browser with the best feedback. It is supported by the whole system like Firefox, but the download address of &lt;a href="https://www.google.cn/chrome/" rel="noopener noreferrer"&gt;Chrome official website&lt;/a&gt; is sometimes downloaded Very slow, you can consider using domestic download sites as appropriate;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170649807.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170649807.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Development assistance
&lt;/h1&gt;

&lt;h2&gt;
  
  
  4.1 Source Code View
&lt;/h2&gt;

&lt;p&gt;Usually, we can view the code of some small projects and use the IDE to import the project source code directly, but when dealing with the source code of some large projects, using the IDE will cause the computer to freeze and seriously affect the user experience. I do Android development by myself, usually in Android Studio, I can view it directly like the project source code, but the source code below the framework layer needs another tool;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sourceInSight&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an excellent source code viewing tool. Whether it is a few G or dozens of G or even hundreds of G, you can use this tool to quickly and efficiently read the code. Of course, there are some skills you can go to the tutorial for details. ；&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170021754.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170021754.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;vim&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux Daniel likes to use Vim to view the source code. I'm not a Daniel, so I don't recommend it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415145544458.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200415145544458.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4.2 FTP file transfer
&lt;/h2&gt;

&lt;p&gt;In the past, I used the XFTP that comes with XShell to do file transfers, but later found that I couldn’t use it for free, so I used the Ftp tool with FinalShell to transfer files, and later I found a more independent transfer tool;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File Zilla
&lt;a href="https://www.filezilla.cn/" rel="noopener noreferrer"&gt;File Zilla&lt;/a&gt;, This is a very easy-to-use and user-friendly Ftp transfer tool. I and my company use this software;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200604092400514.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200604092400514.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FireFTP
&lt;a href="https://fireftp.en.softonic.com/" rel="noopener noreferrer"&gt;FireFTP&lt;/a&gt;,If you do not want to install the software, you can use the Firefox plug-in, provided that you have to install Firefox;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200604092512279.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200604092512279.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4.3 Download software
&lt;/h2&gt;

&lt;p&gt;There are many download tools, but many of them are bloated;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Motrix&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The download speed of the official website address is very slow, I will help you download it in advance. You can go to my resource page to download the corresponding version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170725236.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170725236.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Violent Monkey/Greasy Monkey&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A browser script software that runs on major browsers. After installation, various scripts can be installed to achieve the desired functions. So you may think that's it. What I want to say is that it can crack Vip, compare prices across the entire network, realize direct download from the network disk, and realize that major video websites are free of advertisements. Have you tried it?&lt;/p&gt;

&lt;p&gt;Whether it is a greasy monkey or a violent monkey, you need to install plug-ins to complete these functions. There is a place to search for plug-ins &lt;a href="https://greasyfork.org/zh-CN" rel="noopener noreferrer"&gt;greasyfork&lt;/a&gt;;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200826145536597.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200826145536597.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200826145037433.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200826145037433.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200826145429883.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200826145429883.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bit Wizard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes it is not easy to use, I still recommend Motrix;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170845621.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170845621.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;7Zip&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.7-zip.org/" rel="noopener noreferrer"&gt;7Zip&lt;/a&gt; supports extreme compression, and it does not require cracking like rar. The compression efficiency is just right. For example, I used to zip to compress a directory that was originally 500m after compressed with rar, and the final size was only more than 100M;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20201027141118721.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20201027141118721.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Screen recording and image processing
&lt;/h1&gt;

&lt;h2&gt;
  
  
  5.1 Screen Recording
&lt;/h2&gt;

&lt;p&gt;I sometimes do live broadcasts. I have also been a lecturer before, and I need to record and broadcast. I have used several recording software, and finally only selected two.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FSCapture Pro&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is my favorite screen recording software. It is small in size, simple in interface, and powerful. Many domestic software sites have green versions, and I have uploaded them to the csdn download page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170931303.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170931303.png" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bandicam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is more versatile than the first one. It’s great for game recording. I generally don’t do game recording, so I prefer to use the first one;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170955460.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413170955460.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5.2 Gif recording
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ScreenToGif&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My favorite tool for screen recording Gif. Sometimes we can’t share videos with others, so we can only share pictures. This is a lightweight and memory-saving tool for screen recording Gif. You must not miss it;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413171015377.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413171015377.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LICEcap&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is another tool for recording Gif. It is also lightweight and has a simple interface. I use less but it doesn’t mean it’s bad;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413171040298.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200413171040298.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5.3 Image compression
&lt;/h2&gt;

&lt;p&gt;A processed 3000w pixel picture has dozens of megabytes. In fact, we don’t need such high details. Many times we want to spread on social media, so we hope that the resolution is as large as possible instead of as many details as possible. In fact, when there are too many details, human eyes can't see it at all. This is why the graphics compression algorithm was invented;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Voralent Antelope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a pretty good image compression software, it can compress dozens of megabytes of photos to 2 megabytes and it is difficult for you to distinguish the difference between the two with your naked eyes;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200908160948829.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200908160948829.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PS image batch processing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many awesome uses of PS, batch processing is a built-in script; you can find it in Ps File -&amp;gt; Script -&amp;gt; Image Batch;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200908161218679.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200908161218679.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70%23pic_center" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  6. Format conversion and text recognition
&lt;/h1&gt;

&lt;h2&gt;
  
  
  6.1 Convert Word to PDF
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Word to PDF&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Method 1: After Word2016, it comes with the function of saving as PDF. How to use: Open Word document→File→Save as→Save as the type and select PDF;&lt;/p&gt;

&lt;p&gt;Method 2: Word to print PDF, the computer system needs win7 or higher, operation: open Word document → file → print → click the print button;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PDF to Word&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many people don't know that Word comes with the function of converting PDF to Word. In fact, with the improvement of the Word version, it is completely possible to reverse the PDF that was originally converted from Word.&lt;/p&gt;

&lt;p&gt;All you have to do is to select the PDF document you want to convert, right-click the mouse, and choose to open it with Word2013 or 2016.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527101946639.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527101946639.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;这个时候 Word 友情地提示你，它正在努力地转 Word，但转换之后可能会和 PDF 有点差异，没事，点确认就行；&lt;/p&gt;

&lt;p&gt;At that time, Word kindly reminds you that it is working hard to convert to Word, but it may be a little different from PDF after conversion. It's okay, just click confirm;&lt;/p&gt;

&lt;h2&gt;
  
  
  6.2 Word to Markdown
&lt;/h2&gt;

&lt;p&gt;For example, I read a great article on the Internet, but because Csdn needs MD format files, although I can copy and paste the content to Word by selecting all, I need to convert it to MD. At that time, you need to use the artifact of Writage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://www.writage.com/" rel="noopener noreferrer"&gt;Writage&lt;/a&gt;,This is an artifact that can be converted to markdown by directly saving as in word.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527102336293.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527102336293.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6.3 Image to text
&lt;/h2&gt;

&lt;p&gt;Image-to-text is also called OCR. There is open source code on GitHub, but many people don't know how to compile, or if they are in a hurry, they need to use molded things. For example, this online conversion is easy to use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;XPdf&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://xpdf.net/ocr-images-to-pdf" rel="noopener noreferrer"&gt;xpdf&lt;/a&gt;, Convert pictures to text online for free, unlimited pages. The product also provides PDF to word;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527102800134.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527102800134.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;- ABBYY FineReader&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ABBYY FineReader&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The awesome thing about this thing is that you can directly recognize the content on the picture and save it to Word. After opening the software, click [Graph or PDF file to Microsoft Word], select the document to be converted and then start the conversion.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527103043841.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubhFF1gx_size%2Ccolor%3Duc2FF116g_us" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20200527103043841.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubhFF1gx_size%2Ccolor%3Duc2FF116g_us" alt="Insert picture description here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can download ABBYY FineReader on the official website. After opening the software, click [Graph or PDF file to Microsoft Word], select the document to be converted and start the conversion. The effect is excellent.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Android system init process startup and init.rc full analysis</title>
      <dc:creator>larson</dc:creator>
      <pubDate>Thu, 14 Jan 2021 01:44:07 +0000</pubDate>
      <link>https://dev.to/larsonzhong/android-system-init-process-startup-and-init-rc-full-analysis-22hi</link>
      <guid>https://dev.to/larsonzhong/android-system-init-process-startup-and-init-rc-full-analysis-22hi</guid>
      <description>&lt;p&gt;This is a blog written with heart, and I hope everyone can read it carefully and help find the improvement of the article, thank you;&lt;/p&gt;

&lt;h2&gt;
  
  
  Service startup mechanism
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;parse_config_file (init.rc) in the main function of the system/core/init/init.c file reads and parses the contents of the init.rc file. Place the service information in the service_list of system/core/init/init_parser.cpp&lt;/li&gt;
&lt;li&gt;The main function of the system/core/init/init.c file continues to execute restart_servie_if_needed(...) -&amp;gt; service_start(...) -&amp;gt; Execve(...) to establish the service process;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In order to let everyone see more clearly, the last picture first "Overall Startup Framework":&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgconvert.csdnimg.cn%2FaHR0cDovL2ltZy5ibG9nLmNzZG4ubmV0LzIwMTYwNDI3MTgwNzQxMjA1%3Fx-oss-process%3Dimage%2Fformat%2Cpng" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgconvert.csdnimg.cn%2FaHR0cDovL2ltZy5ibG9nLmNzZG4ubmV0LzIwMTYwNDI3MTgwNzQxMjA1%3Fx-oss-process%3Dimage%2Fformat%2Cpng" alt="这里写图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  init.rc Introduction
&lt;/h2&gt;

&lt;p&gt;At present, Linux has many communication mechanisms that can interact between user space and kernel space, such as device driver files (located in the /dev directory), memory files (/proc, /sys directories, etc.). Students who know Linux should know that one of the important features of Linux is that everything exists in the form of files. For example, a device usually corresponds to one or more device files. These files that interact with the kernel space are in the user space, so after loading in the Linux kernel, you need to first create the directory where these files are located. The program to complete these tasks is the init described in this article. Init is a command line program. One of its main tasks is to create a directory where these files that interact with the kernel space are located. When the Linux kernel is loaded, the first thing to do is to call the init program, that is, init is the first program executed in user space.&lt;/p&gt;

&lt;p&gt;Although the work done by init is not much, the code is still very complicated. &lt;strong&gt;Init program is not composed of one source code file&lt;/strong&gt;, but is formed by linking a set of object files of source code files. These files are located in the following directories.&lt;/p&gt;

&lt;p&gt;It should be understood that these init.rc are just grammar files, not programs. The real entry point is the system/core/init/init.c mentioned above.&lt;br&gt;
Because the init.c file is relatively large, in the second part of the article I will briefly analyze the init startup process through the main function;&lt;/p&gt;

&lt;p&gt;There are two init.rc, located in:&lt;br&gt;
./system/core/rootdir/init.rc&lt;br&gt;
./bootable/recovery/etc/init.rc&lt;br&gt;
It can be guessed from the catalog that the two init.rc usage scenarios are different. One is used for flashing, that is, to enter the recorvery mode, and the other is used for normal startup; our focus here is the above one, which is also init The one associated with .c;&lt;/p&gt;

&lt;h2&gt;
  
  
  init.rc grammatical structure analysis
&lt;/h2&gt;

&lt;p&gt;To understand how init.rc is parsed, we need to look at the documentation first. The documentation is there. Of course, you can also look at the &lt;a href="https://yq.aliyun.com/articles/10311" rel="noopener noreferrer"&gt;Chinese version&lt;/a&gt; ；&lt;br&gt;
init.rc is located in /bootable/recovery/etc/init.rc&lt;/p&gt;

&lt;p&gt;The Android initialization language contains four types of declarations:&lt;br&gt;
Actions (behavior), Commands (command), Services (service) and Options (options)&lt;/p&gt;

&lt;p&gt;All of these are in units of lines, and various signs are separated by spaces.&lt;br&gt;
C-style backslashes can be used to insert spaces between tokens.&lt;br&gt;
Double quotes can also be used to prevent a string from being split into multiple tokens by spaces.&lt;br&gt;
The backslash at the end of the line is used to wrap the line, and the comment line starts with a pound sign (#) (a space is allowed).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;It should be noted that this is only a grammar file, just like an xml file, without execution order, the parser obtains the desired data by reading this file, including service, action, etc.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Actions and Services declare a new grouping Section. All commands or options belong to the most recently declared group. Commands or options before the first group will be ignored.&lt;br&gt;
Actions and Services have unique names. If there is a duplicate name, the second statement will be ignored as an error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Actions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Actions are the start of a series of commands&lt;/strong&gt;&lt;br&gt;
Actions represent some Actions. Actions represent a set of commands (Commands), and Actions have a trigger (trigger) that determines when to execute this Action, that is, under what circumstances can the defined command in the Action be executed. When some conditions meet the conditions of the trigger, the command defined in the Action will be added to the end of the command queue to be executed (if this group of commands is already in the queue, it will not be added again).&lt;/p&gt;

&lt;p&gt;Each action in the queue is extracted in turn, and each command in this action is executed in turn when an Action is removed from the queue.&lt;/p&gt;

&lt;p&gt;The format of Action is as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

on &amp;lt;trgger&amp;gt; [&amp;amp;&amp;amp; &amp;lt;trigger&amp;gt;]*
   &amp;lt;command1&amp;gt;
   &amp;lt;command2&amp;gt;
   &amp;lt;command3&amp;gt;
   ...


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;On is followed by a trigger. When the trigger is triggered, command1, command2, and command3 will be executed in sequence until the next Action or the next Service.&lt;/p&gt;

&lt;p&gt;To put it simply, Actions is a startup script defined by Android at startup. When the conditions are met, the script will be executed. There are some commands in the script, and different scripts are distinguished by on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Triggers (Triggers)
&lt;/h3&gt;

&lt;p&gt;Trigger is the trigger we mentioned above, which is essentially a string that can match a certain event containing the string.&lt;br&gt;
Triggers are subdivided into event triggers and property triggers.&lt;br&gt;
Triggers (triggers) is a string used to match specific event types to make Actions happen.&lt;/p&gt;

&lt;p&gt;Event triggers can be triggered by the "trigger" command or via QueueEventTrigger() during the initialization process, usually some simple strings defined in advance, such as: boot, late-init&lt;br&gt;
Property trigger is triggered when the variable value of the specified property becomes the specified value, and its format is property:=*&lt;/p&gt;

&lt;p&gt;An Action can have multiple attribute triggers, but there is at most one event trigger. Let's look at two examples below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

on boot &amp;amp;&amp;amp; property:a=b


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This Action will only be triggered when the boot event occurs and the attributes a and b are equal.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

on property:a=b &amp;amp;&amp;amp; property:c=d


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The Action will be triggered in the following three situations:&lt;/p&gt;

&lt;p&gt;-At startup, if the value of attribute a is equal to b and the value of attribute c is equal to d&lt;br&gt;
 -When the value of attribute c is already d, the value of attribute a is updated to b&lt;br&gt;
 -When the value of attribute a is already b, the value of attribute c is updated to d&lt;/p&gt;

&lt;p&gt;The following event triggers are commonly used in AIL:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Type Description
-------------------------------------------------
Triggered after boot init.rc is loaded
device-added-&amp;lt;path&amp;gt; triggers when the specified device is added
device-removed-&amp;lt;path&amp;gt; triggers when the specified device is removed
service-exited-&amp;lt;name&amp;gt; is triggered when a specific service (service) exits
Triggered before early-init initialization
Triggered after late-init initialization
Triggered when init is initialized (after /init.conf (startup configuration file) is loaded)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The trigger of Init is determined by the function action_for_each_trigger in init.c (called in the main function).&lt;/p&gt;

&lt;h3&gt;
  
  
  Services
&lt;/h3&gt;

&lt;p&gt;A service is a program that starts with service and is started by the init process. Generally, it runs in another child process of init. Therefore, it is necessary to determine whether the corresponding executable file exists before starting the service. The sub-processes generated by init are defined in the rc file, and each service in it will generate sub-processes through the &lt;a href="http://blog.csdn.net/jason314/article/details/5640969" rel="noopener noreferrer"&gt;fork&lt;/a&gt; method at startup. The form of Services is as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

service &amp;lt;name&amp;gt; &amp;lt;pathname&amp;gt; [&amp;lt;argument&amp;gt; ]*
    &amp;lt;option&amp;gt;
    &amp;lt;option&amp;gt;
    ...


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;among them:&lt;/p&gt;

&lt;p&gt;-name: service name&lt;br&gt;
 -pathname: the program location corresponding to the current service&lt;br&gt;
 -option: the option set by the current service&lt;br&gt;
 -argument optional parameter&lt;/p&gt;

&lt;h2&gt;
  
  
  init.rc file detailed
&lt;/h2&gt;

&lt;p&gt;In order to facilitate understanding, I put the whole init.rc analysis aside, so that everyone can understand the whole process; if you want to understand the init syntax analysis under recovery, refer to this article &lt;a href="//http:/%20/blog.csdn.net/zhonglunshun/article/details/78625375"&gt;"Init.rc syntax analysis under recovery"&lt;/a&gt;&lt;br&gt;
The amount of code is relatively large, if you think it looks laborious, you can pick the green part to see;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# Copyright (C) 2012 The Android Open Source Project
#
# IMPORTANT: Do not create world writable files or directories.
# This is a common source of Android security bugs.
#

"[Import &amp;lt;filename&amp;gt; an init configuration file to extend the current configuration.]"
import /init.environ.rc
import /init.usb.rc
import /init.${ro.hardware}.rc
import /init.${ro.zygote}.rc
import /init.trace.rc

"[Trigger condition early-init, call the following line in the early-init phase]"
on early-init
    # Set init and its forked children's oom_adj.
    write /proc/1/oom_score_adj -1000
"[Open a file with path &amp;lt;path&amp;gt; and write one or more strings]"
    # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
    write /sys/fs/selinux/checkreqprot 0

    # Set the security context for the init process.
    # This should occur before anything else (e.g. ueventd) is started.
    "[This script means that the function setcon is called immediately after the init process is started to set its security context to "u:r:init:s0", that is, the domain of the init process is designated as init.]"
    setcon u:r:init:s0

    # Set the security context of /adb_keys if present.
    "[Restore the specified file to the safe online text environment specified in the file_contexts configuration]"
    restorecon /adb_keys

"[Execute the start ueventd command. ueventd is a service with a definition behind it]"
    start ueventd

"[Mkdir &amp;lt;path&amp;gt; [mode] [owner] [group] //Create a directory &amp;lt;path&amp;gt;, you can optionally specify the mode, owner, and group. If not specified, the default permission is 755, and belongs to the root user and root group.]"
    # create mountpoints
    mkdir /mnt 0775 root system

on init
"[Set the reference of the system clock, such as 0 for GMT, which is based on Greenwich Mean Time]"
    sysclktz 0

"[Set Kernel Log Level]"
loglevel 6 ####
    write /proc/bootprof "INIT: on init start" ####
To
"[Symlink &amp;lt;target&amp;gt; &amp;lt;path&amp;gt; //Create a soft link &amp;lt;target&amp;gt; pointing to &amp;lt;path&amp;gt;.]"
    # Backward compatibility
    symlink /system/etc /etc
    symlink /sys/kernel/debug /d

    # Right now vendor lives on the same filesystem as system,
    # but someday that may change.
    symlink /system/vendor /vendor

"[Create a directory &amp;lt;path&amp;gt;, you can optionally specify mode, owner and group.]"
    # Create cgroup mount point for cpu accounting
    mkdir /acct
    mount cgroup none /acct cpuacct
    mkdir /acct/uid

"[Mount &amp;lt;type&amp;gt; &amp;lt;device&amp;gt; &amp;lt;dir&amp;gt; [&amp;lt;mountoption&amp;gt;] //Mount the specified device in the directory &amp;lt;dir&amp;gt;. &amp;lt;device&amp;gt; can specify an mtd block device in the form of mtd@name. &amp;lt;mountoption&amp;gt; Including ro, rw, remount, noatime, ...]"
    # Create cgroup mount point for memory
    mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
    mkdir /sys/fs/cgroup/memory 0750 root system
    mount cgroup none /sys/fs/cgroup/memory memory
    write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
    "[Chown &amp;lt;owner&amp;gt; &amp;lt;group&amp;gt; &amp;lt;path&amp;gt; //Change the owner and group of the file.]"

    "[Some of the following lines are omitted because they are similar]"
    .....

# Healthd can trigger a full boot from charger mode by signaling this
# property when the power button is held.
on property:sys.boot_from_charger_mode=1
"[Stop all running services under the specified service category]"
    class_stop charger
    "[Trigger an event, arrange the action after a certain action (for Action queuing)]"
    trigger late-init

# Load properties from /system/ + /factory after fs mount.
on load_all_props_action
"[Load attributes from /system, /vendor. It is included in init.rc by default]"
    load_all_props

# Indicate to fw loaders that the relevant mounts are up.
on firmware_mounts_complete
"[Delete the file under the specified path]"
    rm /dev/.booting

# Mount filesystems and start core system services.
on late-init
"[Trigger an event. Used to arrange an action with another action.]"
    trigger early-fs
    trigger fs
    trigger post-fs
    trigger post-fs-data

    # Load properties from /system/ + /factory after fs mount. Place
    # this in another action so that the load will be scheduled after the prior
    # issued fs triggers have completed.
    trigger load_all_props_action

    # Remove a file to wake up anything waiting for firmware.
    trigger firmware_mounts_complete

    trigger early-boot
    trigger boot


on post-fs
...
    "[Some operations for creating directories, establishing links, and changing permissions are omitted here]"

on post-fs-data
...
"[Some operations for creating directories, establishing links, and changing permissions are omitted here]"

"[Restore the specified file to the safe online text environment specified in the file_contexts configuration]"
    restorecon /data/mediaserver

"[Set the value of the system property &amp;lt;name&amp;gt; to &amp;lt;value&amp;gt;, that is, set the system property in the form of key-value pairs]"
    # Reload policy from /data/security if present.
    setprop selinux.reload_policy 1

"[Recursively restore the specified directory to the security context specified in the file_contexts configuration]"
    # Set SELinux security contexts on upgrade or policy update.
    restorecon_recursive /data

    # If there is no fs-post-data action in the init.&amp;lt;device&amp;gt;.rc file, you
    # must uncomment this line, otherwise encrypted filesystems
    # won't work.
    # Set indication (checked by vold) that we have finished this action
    #setprop vold.post_fs_data_done 1

on boot
"[Initialize Network]"
    # basic network init
    ifup lo
    "[Set the host name to localhost]"
    hostname localhost
    "[Set the domain name localdomain]"
    domainname localdomain

"[Set Resource Limit]"
    # set RLIMIT_NICE to allow priorities from 19 to -20
    setrlimit 13 40 40

"[Some chmod, chown, and other operations are omitted here, no more explanation]"
   ...


    # Define default initial receive window size in segments.
    setprop net.tcp.default_init_rwnd 60
To
"[Restart core service]"
    class_start core

on nonencrypted
    class_start main
    class_start late_start

on property:vold.decrypt=trigger_default_encryption
    start defaultcrypto

on property:vold.decrypt=trigger_encryption
    start surfaceflinger
    start encrypt

on property:sys.init_log_level=*
    loglevel ${sys.init_log_level}

on charger
    class_start charger

on property:vold.decrypt=trigger_reset_main
    class_reset main

on property:vold.decrypt=trigger_load_persist_props
    load_persist_props

on property:vold.decrypt=trigger_post_fs_data
    trigger post-fs-data

on property:vold.decrypt=trigger_restart_min_framework
    class_start main

on property:vold.decrypt=trigger_restart_framework
    class_start main
    class_start late_start

on property:vold.decrypt=trigger_shutdown_framework
    class_reset late_start
    class_reset main

on property:sys.powerctl=*
    powerctl ${sys.powerctl}

# system server cannot write to /proc/sys files,
# and chown/chmod does not work for /proc/sys/ entries.
# So proxy writes through init.
on property:sys.sysctl.extra_free_kbytes=*
    write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes}

# "tcp_default_init_rwnd" Is too long!
on property:sys.sysctl.tcp_def_init_rwnd=*
    write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd}

"[Daemon Process]"
## Daemon processes to be run by init.
##
service ueventd /sbin/ueventd
    class core
    critical
    seclabel u:r:ueventd:s0

"[Log Service Process]"
service logd /system/bin/logd
    class core
    socket logd stream 0666 logd logd
    socket logdr seqpacket 0666 logd logd
    socket logdw dgram 0222 logd logd
    seclabel u:r:logd:s0

"[Healthd is an intermediary model proposed after android4.4. This model listens to battery events from the bottom layer and transmits battery data information upward to the BatteryService of the Framework layer to calculate battery power related status information]"
service healthd /sbin/healthd
    class core
    critical
    seclabel u:r:healthd:s0

"[Console Process]"
service console /system/bin/sh
"[Set a category for the current service. Services of the same category will be started or stopped at the same time, the default class name is default]"
    class core
    "[Service requires a console]"
    console
    "[The service will not start automatically, it must be explicitly started by the service name]"
    disabled
    "[Switch the user name before executing this service, the current default is root. Since Android M, even if it requires linux capabilities, this option should be used. Obviously, in order to get this function, the process needs to be run as root]"
    user shell
    seclabel u:r:shell:s0

on property:ro.debuggable=1
    start console

# adbd is controlled via property triggers in init.&amp;lt;platform&amp;gt;.usb.rc
service adbd /sbin/adbd --root_seclabel=u:r:su:s0
    class core
    "[Create a socket under the unix domain, which is named /dev/socket/&amp;lt;name&amp;gt;. And returns its file descriptor fd to the service process. Among them, the type must be dgram, stream or seqpacke, and the default for user and group is 0.seclabel is the security context of the SELLinux of the socket, the default is the context of the current service, specified by seclabel]"
    socket adbd stream 660 system system
    disabled
    seclabel u:r:adbd:s0

# adbd on at boot in emulator
on property:ro.kernel.qemu=1
    start adbd

"[Memory management service, memory is insufficient to release memory]"
service lmkd /system/bin/lmkd
    class core
    critical
    socket lmkd seqpacket 0660 system system

"[ServiceManager is a daemon process that maintains the binder communication between system services and clients.
The most used communication mechanism in the Android system is Binder, which is mainly composed of Client, Server, ServiceManager and Binder drivers. Among them, Client, Service, and ServiceManager run in user space, while Binder driver runs in kernel space. The core component is the Binder driver, and ServiceManager provides auxiliary management functions, whether it is Client or Service before communicating with ServiceManager. The ServiceManager is a daemon process that is responsible for managing the Server and providing the client with the function of querying the Server. 】"
service servicemanager /system/bin/servicemanager
    class core
    user system
    group system
    critical
    onrestart restart healthd
    "[Zygote service will be restarted when the servicemanager service starts]"
    onrestart restart zygote
    onrestart restart media
    onrestart restart surfaceflinger
    onrestart restart drm

"[Vold is the abbreviation of Volume Daemon, it is the control center of the external storage system in the Android platform, and is the background process for managing and controlling the external storage device of the Android platform]"
service vold /system/bin/vold
    class core
    socket vold stream 0660 root mount
    ioprio be 2

"[Netd is a background daemon program specifically responsible for network management and control in the Android system]"
service netd /system/bin/netd
    class main
    socket netd stream 0660 root system
    socket dnsproxyd stream 0660 root inet
    socket mdns stream 0660 root system
    socket fwmarkd stream 0660 root inet

"[Debuggerd is a daemon process, which starts with the init process when the system starts. It is mainly responsible for dumping the information of the process running to a file or console]"
service debuggerd /system/bin/debuggerd
    class main

service debuggerd64 /system/bin/debuggerd64
    class main

"[Android RIL (Radio Interface Layer) provides an abstraction layer between Telephony services and Radio hardware]"
# for using TK init.modem.rc rild-daemon setting
#service ril-daemon /system/bin/rild
# class main
# socket rild stream 660 root radio
# socket rild-debug stream 660 radio system
# user root
# group radio cache inet misc audio log

"[Provides a system-wide surface composer function, which can combine 2D and 3D surfaces of various applications.]"
service surfaceflinger /system/bin/surfaceflinger
    class core
    user system
    group graphics drmrpc
    onrestart restart zygote

"[DRM can directly access the hardware of DRM clients. The DRM driver is used to handle DMA, memory management, resource locks, and secure hardware access. In order to support multiple 3D applications at the same time, the 3D graphics card hardware must be used as a shared resource, so a lock is required Provide mutually exclusive access. DMA transfer and AGP interface are used to send buffers for graphics operations to the graphics hardware, so it is necessary to prevent the client from unauthorized access to the graphics hardware.]"
#make sure drm server has rights to read and write sdcard ####
service drm /system/bin/drmserver
    class main
    user drm
    # group drm system inet drmrpc ####
    group drm system inet drmrpc sdcard_r ####

"[Media Services, no need to say more]"
service media /system/bin/mediaserver
    class main
    user root ####
# google default ####
# user media ####
    group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm media sdcard_r system net_bt_stack ####
# google default ####
# group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm ####

    ioprio rt 4

"[Device Encryption Related Services]"
# One shot invocation to deal with encrypted volume.
service defaultcrypto /system/bin/vdc --wait cryptfs mountdefaultencrypted
    disabled
    "[When the service exits, do not restart the service]"
    oneshot
    # vold will set vold.decrypt to trigger_restart_framework (default
    # encryption) or trigger_restart_min_framework (other encryption)

# One shot invocation to encrypt unencrypted volumes
service encrypt /system/bin/vdc --wait cryptfs enablecrypto inplace default
    disabled
    oneshot
    # vold will set vold.decrypt to trigger_restart_framework (default
    # encryption)

"[Startup Animation Service]"
service bootanim /system/bin/bootanimation
    class core
    user graphics
# group graphics audio ####
    group graphics media audio ####
    disabled
    oneshot

"[In the Android system, PackageManagerService is used to manage all the installation package information in the system and the installation and uninstallation of applications, but the installation and uninstallation of applications is not completed by PackageManagerService, but through PackageManagerService to access the installd service to execute the package Installed and uninstalled.]"
service installd /system/bin/installd
    class main
    socket installd stream 600 system system

service flash_recovery /system/bin/install-recovery.sh
    class main
    seclabel u:r:install_recovery:s0
    oneshot

"[Vpn related services]"
service racoon /system/bin/racoon
    class main
    socket racoon stream 600 system system
    # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
    group vpn net_admin inet
    disabled
    oneshot

"[There are mtpd commands in android to connect to vpn]"
service mtpd /system/bin/mtpd
    class main
    socket mtpd stream 600 system system
    user vpn
    group vpn net_admin inet net_raw
    disabled
    oneshot

service keystore /system/bin/keystore /data/misc/keystore
    class main
    user keystore
    group keystore drmrpc

"[You can use dumpstate to obtain various information about the device]"
service dumpstate /system/bin/dumpstate -s
    class main
    socket dumpstate stream 0660 shell log
    disabled
    oneshot

"[Mdnsd is a daemon for multicast DNS and DNS service discovery.]"
service mdnsd /system/bin/mdnsd
    class main
    user mdnsr
    group inet net_raw
    socket mdnsd stream 0660 mdnsr inet
    disabled
    oneshot

"[Trigger shutdown process to continue down]"
service pre-recovery /system/bin/uncrypt
    class main
    disabled
    "[When the service exits, do not restart the service]"
    oneshot



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  init.c full analysis
&lt;/h2&gt;

&lt;p&gt;Next, we analyze the execution process of the following main function in detail; it may be relatively long, so please take a look:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


int main( int argc, char **argv)
{
#Create some directories in the linux root file system
mkdir( "/dev", 0755 );
mkdir( "/proc", 0755 );
mkdir( "/sys", 0755 );

mount( "tmpfs", "/dev", "tmpfs", 0, "mode=0755" );
mkdir( "/dev/pts", 0755 );
mkdir( "/dev/socket", 0755 );
mount( "devpts", "/dev/pts", "devpts", 0, NULL );
mount( "proc", "/proc", "proc", 0, NULL );
mount( "sysfs", "/sys", "sysfs", 0, NULL );
#init's standard input, standard output, and standard error file descriptors are directed to __null__, which means that there is no input and output, and all its input and output are written to Log
open_devnull_stdio();
#Initial log Write init information
log_init();
#Read and parse the init.rc file (this file is in the root directory)
parse_config_file( "/init.rc" );
#Get hardware To print our device name fs100
get_hardware_name();
snprintf( tmp, sizeof(tmp), "/init.%s.rc", hardware );
    #Read and parse hardware-related init script files,
parse_config_file( tmp );
# Trigger the action named early-init in the init script file and execute its commands, which is actually: on early-init
action_for_each_trigger( "early-init", action_add_queue_tail );
drain_action_queue();
#Initialize dynamic device management, react to the kernel when the device file changes, which will be explained later
device_fd = device_init(); # Initialize device management
#Load the startup animation. If the animation fails to open, print on the screen: A N D R O I D.
if (load_565rle_image( INIT_IMAGE_FILE))
{
fd = open( "/dev/tty0", O_WRONLY );
if (fd &amp;gt;= 0)
{
const char *msg;
msg = "\n"
"\n"
"\n"
879 "\n"
"\n"
"\n"
"\n" /* console is 40 cols x 30 lines */
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
/* "A N D R O I D "; boot animation */
write( fd, msg, strlen( msg) );
close( fd );
}
}

#Trigger The action named init in the init script file and execute its commands is actually: on init
action_for_each_trigger( "init", action_add_queue_tail );
drain_action_queue();
#Start the system property service: system property service
property_set_fd = start_property_service();
#Create socket to handle orphan process signals
if (socketpair( AF_UNIX, SOCK_STREAM, 0, s) == 0)
{
signal_fd = s[0];
signal_recv_fd = s[1];
fcntl( s[0], F_SETFD, FD_CLOEXEC );
fcntl( s[0], F_SETFL, O_NONBLOCK );
fcntl( s[1], F_SETFD, FD_CLOEXEC );
fcntl( s[1], F_SETFL, O_NONBLOCK );
}
#Trigger The actions named early-boot and boot in the init script file and execute their commands are actually: on early-boot and on boot
action_for_each_trigger( "early-boot", action_add_queue_tail );
action_for_each_trigger( "boot", action_add_queue_tail );
drain_action_queue();
#Start all property change trigger commands, which is actually: on property:ro.xx.xx=xx
queue_all_property_triggers();
drain_action_queue();
#Enter the infinite loop ()
for (;;)
{
#Start all services declared in the init script,
#如：266 service servicemanager /system/bin/servicemanager
#user system
#critical
#onrestart restart zygote
#onrestart restart media
restart_processes();
#Multi-channel monitoring equipment management, child process running status, attribute service
nr = poll( ufds, fd_count, timeout );
if (nr &amp;lt;= 0)
continue;
if (ufds[2].revents == POLLIN)
{
read( signal_recv_fd, tmp, sizeof(tmp) );
while (!wait_for_one_process( 0))
;
continue;
}

if (ufds[0].revents == POLLIN)
handle_device_fd( device_fd );

if (ufds[1].revents == POLLIN)
handle_property_set_fd( property_set_fd );
if (ufds[3].revents == POLLIN)
handle_keychord( keychord_fd );
}

return(0);
}



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>android</category>
      <category>initrc</category>
      <category>systems</category>
    </item>
    <item>
      <title>Most complete ADB command manual</title>
      <dc:creator>larson</dc:creator>
      <pubDate>Tue, 12 Jan 2021 09:58:19 +0000</pubDate>
      <link>https://dev.to/larsonzhong/most-complete-adb-commands-4pcg</link>
      <guid>https://dev.to/larsonzhong/most-complete-adb-commands-4pcg</guid>
      <description>&lt;ul&gt;
&lt;li&gt;What is ADB&lt;/li&gt;
&lt;li&gt;ADB Architecture&lt;/li&gt;
&lt;li&gt;ADB port is occupied&lt;/li&gt;
&lt;li&gt;
Basic usage

&lt;ul&gt;
&lt;li&gt;Command syntax&lt;/li&gt;
&lt;li&gt;Specify the target device for the command&lt;/li&gt;
&lt;li&gt;start stop&lt;/li&gt;
&lt;li&gt;View adb version&lt;/li&gt;
&lt;li&gt;Run adbd as root&lt;/li&gt;
&lt;li&gt;Specify the network port of adb server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Device connection management

&lt;ul&gt;
&lt;li&gt;Query connected devices/emulators&lt;/li&gt;
&lt;li&gt;USB connection&lt;/li&gt;
&lt;li&gt;Wireless connection (USB cable required)&lt;/li&gt;
&lt;li&gt;Wireless connection (no need to use USB cable)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Application Management

&lt;ul&gt;
&lt;li&gt;View application list&lt;/li&gt;
&lt;li&gt;All applications&lt;/li&gt;
&lt;li&gt;system applications&lt;/li&gt;
&lt;li&gt;third-party usage&lt;/li&gt;
&lt;li&gt;Install APK&lt;/li&gt;
&lt;li&gt;Adb install internal principle introduction&lt;/li&gt;
&lt;li&gt;Uninstall the app&lt;/li&gt;
&lt;li&gt;Clear application data and cache&lt;/li&gt;
&lt;li&gt;View foreground activity&lt;/li&gt;
&lt;li&gt;View running Services&lt;/li&gt;
&lt;li&gt;View application details&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Interact with the application

&lt;ul&gt;
&lt;li&gt;Activating Activity&lt;/li&gt;
&lt;li&gt;Transfer Service&lt;/li&gt;
&lt;li&gt;Send broadcast&lt;/li&gt;
&lt;li&gt;Forcibly stop the application&lt;/li&gt;
&lt;li&gt;Disable apps and start&lt;/li&gt;
&lt;li&gt;Revoke the permissions of the application&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

File Management

&lt;ul&gt;
&lt;li&gt;Copy the files in the device to the computer&lt;/li&gt;
&lt;li&gt;Copy files from computer to device&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Simulation key/input

&lt;ul&gt;
&lt;li&gt;Power button&lt;/li&gt;
&lt;li&gt;menu&lt;/li&gt;
&lt;li&gt;HOME key&lt;/li&gt;
&lt;li&gt;return key&lt;/li&gt;
&lt;li&gt;volume control&lt;/li&gt;
&lt;li&gt;Media Control&lt;/li&gt;
&lt;li&gt;Turn on/off the screen&lt;/li&gt;
&lt;li&gt;Slide to unlock&lt;/li&gt;
&lt;li&gt;Enter text&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

View log

&lt;ul&gt;
&lt;li&gt;Android log&lt;/li&gt;
&lt;li&gt;Kernel log&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

View device information

&lt;ul&gt;
&lt;li&gt;Model&lt;/li&gt;
&lt;li&gt;Battery status&lt;/li&gt;
&lt;li&gt;Screen Resolution&lt;/li&gt;
&lt;li&gt;Screen density&lt;/li&gt;
&lt;li&gt;Display parameters&lt;/li&gt;
&lt;li&gt;android_id&lt;/li&gt;
&lt;li&gt;IMEI&lt;/li&gt;
&lt;li&gt;Android system version&lt;/li&gt;
&lt;li&gt;IP address&lt;/li&gt;
&lt;li&gt;Mac address&lt;/li&gt;
&lt;li&gt;CPU information&lt;/li&gt;
&lt;li&gt;Memory information&lt;/li&gt;
&lt;li&gt;More hardware and system properties&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Modify settings

&lt;ul&gt;
&lt;li&gt;Resolution&lt;/li&gt;
&lt;li&gt;Screen density&lt;/li&gt;
&lt;li&gt;Display area&lt;/li&gt;
&lt;li&gt;Turn off USB debugging mode&lt;/li&gt;
&lt;li&gt;Display and hide status bar and navigation bar&lt;/li&gt;
&lt;li&gt;Return to normal mode&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Useful functions

&lt;ul&gt;
&lt;li&gt;Screenshots&lt;/li&gt;
&lt;li&gt;Record screen&lt;/li&gt;
&lt;li&gt;Remount.&lt;/li&gt;
&lt;li&gt;View connected WiFi passwords&lt;/li&gt;
&lt;li&gt;Set the system date and time&lt;/li&gt;
&lt;li&gt;restart cellphone&lt;/li&gt;
&lt;li&gt;Check if the device is rooted&lt;/li&gt;
&lt;li&gt;Use Monkey for stress testing&lt;/li&gt;
&lt;li&gt;Turn on/off WiFi&lt;/li&gt;
&lt;li&gt;Turn on/off data traffic&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Flashing related commands

&lt;ul&gt;
&lt;li&gt;Restart to Recovery mode&lt;/li&gt;
&lt;li&gt;Restart from Recovery to Android&lt;/li&gt;
&lt;li&gt;Restart to Fastboot mode&lt;/li&gt;
&lt;li&gt;Update the system via sideload&lt;/li&gt;
&lt;li&gt;More adb shell commands&lt;/li&gt;
&lt;li&gt;View process&lt;/li&gt;
&lt;li&gt;View real-time resource usage&lt;/li&gt;
&lt;li&gt;View process UID&lt;/li&gt;
&lt;li&gt;Other&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Security related

&lt;ul&gt;
&lt;li&gt;Enable SELinux&lt;/li&gt;
&lt;li&gt;Disable SELinux&lt;/li&gt;
&lt;li&gt;Enable dm_verity&lt;/li&gt;
&lt;li&gt;Disable dm_verity&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

common problem

&lt;ul&gt;
&lt;li&gt;Failed to start adb server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;The content of this article is integrated from the Internet, welcome to reprint. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I believe that friends who do Android development have used ADB commands, but they are only limited to installing application push files and device restarting. I don’t know the deeper ones. In fact, we can understand a little more. There are some uncommon scenarios we should at least Knowing that it can be done, for example, we know adb install but not adb shell am start. The former is used to install software, and the latter is used to open the software. A usage scenario of the latter makes me pay attention to him: the company customizes the Android system. When debugging the screen, it depends on whether the screen is full to verify that the driver is normal. This is a troublesome approach. It is to be installed and opened in the hands of Android developers with eclipse or other ide. Obviously, it is much more complicated than the driver who connects the data line and uses the adb command. Therefore, it is necessary to know more.&lt;/p&gt;

&lt;p&gt;The following may be more cumbersome, I will try to be simple, please be patient and finish reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is ADB
&lt;/h2&gt;




&lt;p&gt;The full name of Adb is Android Debug Bridge: Android Debug Bridge. The picture below shows the official introduction of Adb by Android:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20190620094906531.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20190620094906531.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It can be seen that the original intention of Android is to use a tool such as adb to assist developers in debugging apk faster and better in the process of developing android applications, so adb has the ability to install and uninstall apk, copy and push files, view device hardware information, and view Functions such as applications occupying resources and executing shell commands on the device;&lt;/p&gt;

&lt;p&gt;We can find the adb tool in the platform-tools directory of the android sdk installation directory;&lt;/p&gt;

&lt;p&gt;The permission mechanism of the existing Android system is becoming more and more perfect. Many operations that hope to bypass the permission management mechanism are no longer available, but Adb can achieve it. In fact, Adb has a lot of authority to some extent, even on the latest version of the Android system. Because Adb is designed to facilitate debugging by developers, it is necessary to expose some interfaces outside of permissions. So many companies can use this feature to &lt;strong&gt;bypass the permission mechanism&lt;/strong&gt; to do some operations on non-Root non-customized machines (the specific usage is mentioned below), of course, there are also various ways, such as connecting via mobile phone OTG, which will not be repeated here.&lt;/p&gt;

&lt;h2&gt;
  
  
  ADB Architecture
&lt;/h2&gt;

&lt;p&gt;In order to facilitate understanding, we start with three instructions, we often use adb start-server, adb devices, adb kill-server.&lt;br&gt;
Then we often see this output interface:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

C:\Users\dell&amp;gt;adb devices
List of devices attached
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So there are three questions here, why is the server, the server corresponds to the server or the server? If the mobile phone is the client, does the server refer to the service opened on the computer. And what is this daemon?&lt;/p&gt;

&lt;p&gt;ADB is a C/S architecture application, composed of three parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adb client running on the PC side:
 The command line program "adb" is used to run adb commands from a shell or script. First, the "adb" program tries to locate the ADB server on the host. If the ADB server cannot be found, the "adb" program automatically starts an ADB server. Next, when the adbd of the device and the adb server on the pc side establish a connection, the adb client can send a service request to the ADB servcer;&lt;/li&gt;
&lt;li&gt;Adb server running on the PC side:
 ADB Server is a background process running on the host. Its function is to detect the connection and removal of the USB port sensing device, and the start or stop of the emulator instance. ADB Server also needs to send the request of the adb client to the corresponding adbd via usb or tcp;&lt;/li&gt;
&lt;li&gt;The resident process adb demon (adbd) running on the device side:
 The program "adbd" runs as a background process in the Android device or emulator system. Its function is to connect to the ADB server and provide some services for the client running on the host;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20190620094923717.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20190620094933317.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg-blog.csdnimg.cn%2F20190620094933317.png%3Fx-oss-process%3Dimage%2Fwatermark%2Ctype_ZmFuZ3poZW5naGVpdGk%2Cshadow_10%2Ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob25nbHVuc2h1bg%3D%3D%2Csize_16%2Ccolor_FFFFFF%2Ct_70" alt="在这里插入图片描述"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ADB port is occupied
&lt;/h2&gt;

&lt;p&gt;A small partner said that he hoped that I would put the Adb startup problem at the top, because he often encountered the problem of adb unable to find the device, then I will put it in front, I think it is definitely not only she will encounter this situation .&lt;/p&gt;

&lt;p&gt;5037 is the default port of adb. If port 5037 is occupied, we will be troubled by not finding the device when using the Adb command. This problem is often encountered for those who are not very familiar with Adb, so I will This usage is placed at the beginning of the article so that friends can find it easily;&lt;br&gt;
The idea of ​​solving this kind of port occupation problem is the same, three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find the Pid of the process using the port;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

C:&lt;span class="se"&gt;\W&lt;/span&gt;indows&lt;span class="se"&gt;\s&lt;/span&gt;ystem32&amp;gt;netstat &lt;span class="nt"&gt;-aon&lt;/span&gt;|findstr 5037
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 3172


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Find the corresponding process name through PID (easy to locate, you can skip);&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

C:&lt;span class="se"&gt;\W&lt;/span&gt;indows&lt;span class="se"&gt;\s&lt;/span&gt;ystem32&amp;gt;tasklist /fi &lt;span class="s2"&gt;"PID eq 3172"&lt;/span&gt;

Image name PID session name session# memory usage
&lt;span class="o"&gt;=========================&lt;/span&gt; &lt;span class="o"&gt;========&lt;/span&gt; &lt;span class="o"&gt;================&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;==========&lt;/span&gt; &lt;span class="o"&gt;============&lt;/span&gt;
360MobileLink.exe 3172 Console 4 40,208 K


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Use the command to terminate the operation of the command;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

C:&lt;span class="se"&gt;\U&lt;/span&gt;sers&lt;span class="se"&gt;\w&lt;/span&gt;wx229495&amp;gt;taskkill /pid 3172 /f
Success: The process with PID 3172 has been terminated.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Sometimes, some rogue programs will copy a copy of Adb.exe to the windows environment variable, such as C://Windows/system32, at this time we can use Where&lt;br&gt;
The Adb command finds out the path where adb is located and deletes it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Basic usage
&lt;/h2&gt;




&lt;p&gt;What can adb do? The answer is that all operations that can be performed on mobile phones can be implemented with adb. That is to say, if you play 6, your touch screen is completely broken, and the display is completely broken, just give you a motherboard, and you can still complete the actions you want to do. Of course, this is not recommended in general scenarios, efficiency is the priority.&lt;/p&gt;

&lt;p&gt;The following content is transferred from the &lt;a href="https://github.com/mzlogin/awesome-adb" rel="noopener noreferrer"&gt;blog&lt;/a&gt; of a big cow on github. If there is any infringement, please inform and delete it immediately;&lt;br&gt;
Late&lt;/p&gt;

&lt;h3&gt;
  
  
  Command syntax
&lt;/h3&gt;

&lt;p&gt;The basic syntax of the adb command is as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb [-d|-e|-s ] &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If there is only one device/emulator connected, you can omit the part [-d|-e|-s ] and use adb  directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Specify the target device for the command
&lt;/h3&gt;

&lt;p&gt;If there are multiple devices/emulators connected, you need to specify the target device for the command.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;-d&lt;/td&gt;
&lt;td&gt;Specify the only Android device currently connected via USB as the command target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-e&lt;/td&gt;
&lt;td&gt;Specify the only simulator currently running as the command target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-s &amp;lt;serialNumber&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify the device/emulator with the corresponding serialNumber number as the command target&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When multiple devices/emulators are connected, the -s  parameter is commonly used. The serialNumber can be obtained through the adb devices command. Such as:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ adb devices

List of devices attached
cf264b8f device
emulator-5554 device
10.129.164.6:5555 device


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Cf264b8f, emulator-5554 and 10.129.164.6:5555 in the output are serialNumber.&lt;/p&gt;

&lt;p&gt;For example, you want to specify the device cf264b8f to run the adb command to obtain the screen resolution:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb -s cf264b8f shell wm size


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Another example is to install an application on the device 10.129.164.6:5555 (the format of serialNumber in this form is :, which is generally a wirelessly connected device or a third-party Android emulator such as Genymotion):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb -s 10.129.164.6:5555 install test.apk


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;*In the case of multiple devices/simulators, these parameters are used to specify the target device for the command. The following is a simplified description and will not be repeated. *&lt;/p&gt;

&lt;h3&gt;
  
  
  start stop
&lt;/h3&gt;

&lt;p&gt;Start the adb server command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb start-server


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;(Generally, there is no need to manually execute this command. If you find that the adb server is not started when running the adb command, it will be automatically activated.)&lt;/p&gt;

&lt;p&gt;Stop the adb server command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb kill-server


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  View adb version
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb version


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Android Debug Bridge version 1.0.36
Revision 8f855a3d9b35-android


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Run adbd as root
&lt;/h3&gt;

&lt;p&gt;The operating principle of adb is that the adb server on the PC side establishes a connection with the daemon adbd on the mobile phone side, and then the adb client on the PC side forwards the command through the adb server, and adbd parses and runs after receiving the command.&lt;/p&gt;

&lt;p&gt;So if adbd is executed with normal permissions, some commands that require root permissions to execute cannot be directly executed with adb xxx. At this time, you can execute commands after adb shell and then su, or you can let adbd execute with root privileges, which can execute high-privileged commands at will.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb root


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Normal output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

restarting adbd as root


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now run adb shell again and see if the command line prompt becomes #?&lt;/p&gt;

&lt;p&gt;Some mobile phones cannot be executed with root privileges through the adb root command after rooting. For example, some Samsung models will prompt adbd cannot run as root in production builds. You can install &lt;strong&gt;adbd Insecure&lt;/strong&gt; first, and then adb root Try it.&lt;/p&gt;

&lt;p&gt;Correspondingly, if you want to restore adbd to non-root privileges, you can use the &lt;strong&gt;adb unroot&lt;/strong&gt; command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Specify the network port of adb server
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb -P &amp;lt;port&amp;gt; start-server


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The default port is 5037.&lt;/p&gt;

&lt;h2&gt;
  
  
  Device connection management
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Query connected devices/emulators
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb devices


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

List of devices attached
cf264b8f device
emulator-5554 device
10.129.164.6:5555 device


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The output format is [serialNumber] [state], serialNumber is what we often call SN, and the state is as follows:&lt;/p&gt;

&lt;p&gt;offline —— Indicates that the device is not successfully connected or has no response.&lt;/p&gt;

&lt;p&gt;device-The device is connected. Note that this state does not indicate that the Android system has been fully started and operable. The device instance can be connected to adb during the device startup process, but the system will be in an operable state after startup.&lt;/p&gt;

&lt;p&gt;no device —— No device/emulator connection.&lt;/p&gt;

&lt;p&gt;The above output shows that three devices/emulators are currently connected, and cf264b8f, emulator-5554 and 10.129.164.6:5555 are their SNs respectively. It can be seen from the name emulator-5554 that it is an Android emulator, and 10.129.164.6:5555, which is the serialNumber of the form :, is generally a wirelessly connected device or a third-party Android emulator such as Genymotion.&lt;/p&gt;

&lt;p&gt;Common abnormal output:&lt;/p&gt;

&lt;p&gt;No device/emulator is successfully connected.&lt;/p&gt;

&lt;p&gt;List of devices attached&lt;br&gt;
The device/emulator is not connected to adb or not responding.&lt;/p&gt;

&lt;p&gt;List of devices attached&lt;br&gt;
cf264b8f offline&lt;/p&gt;

&lt;h3&gt;
  
  
  USB connection
&lt;/h3&gt;

&lt;p&gt;To use adb normally through USB connection, you need to ensure several points:&lt;/p&gt;

&lt;p&gt;The hardware status is normal.&lt;/p&gt;

&lt;p&gt;Including the Android device is in the normal boot state, the USB cable and various interfaces are intact.&lt;/p&gt;

&lt;p&gt;Developer options and USB debugging mode for Android devices are turned on.&lt;/p&gt;

&lt;p&gt;You can go to "Settings"-"Developer Options"-"Android Debugging" to view.&lt;/p&gt;

&lt;p&gt;If you can't find the developer option in the settings, you need to use an easter egg to show it: click the "version number" 7 times in "Settings"-"About Phone".&lt;/p&gt;

&lt;p&gt;The device drive status is normal.&lt;/p&gt;

&lt;p&gt;It seems that you don’t need to worry about this under Linux and Mac OS X. Under Windows, you may encounter a situation where you need to install a driver. To confirm this, you can right-click "Computer"-"Properties" and go to the "Device Manager" to view related devices Whether there is a yellow exclamation mark or question mark, if not, it means the drive status is good. Otherwise, you can download a mobile assistant program to install the driver first.&lt;/p&gt;

&lt;p&gt;Confirm the status after connecting the computer and the device via the USB cable.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb devices


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you can see&lt;br&gt;
xxxxxx device&lt;br&gt;
The connection is successful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wireless connection (USB cable required)
&lt;/h3&gt;

&lt;p&gt;In addition to connecting the device and the computer via USB to use adb, you can also use a wireless connection-although there are steps to use USB during the connection process, your device can get rid of the limitation of the USB cable within a certain range after the connection is successful. !&lt;/p&gt;

&lt;p&gt;Steps:&lt;br&gt;
Connect the Android device and the computer to run adb to the same local area network, for example to the same WiFi.&lt;br&gt;
Connect the device to the computer via a USB cable.&lt;br&gt;
Make sure that the connection is successful (you can run adb devices to see if the device can be listed).&lt;br&gt;
Let the device monitor TCP/IP connections on port 5555:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb tcpip 5555


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Disconnect the USB connection.&lt;br&gt;
Find the IP address of the device.&lt;br&gt;
Generally, it can be found in "Settings"-"About Phone"-"Status Information"-"IP Address", or you can use the adb command to view it using the method in the section View Device Information-IP Address below.&lt;/p&gt;

&lt;p&gt;Connect the device by IP address.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb connect &amp;lt;device-ip-address&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here  is the device IP address found in the previous step.&lt;/p&gt;

&lt;p&gt;Confirm the connection status.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb devices


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you can see&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;device-ip-address&amp;gt;:5555 device


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The connection is successful.&lt;br&gt;
If you can't connect, please confirm that the Android device and the computer are connected to the same WiFi, and then execute the step of &lt;code&gt;adb connect &amp;lt;device-ip-address&amp;gt;&lt;/code&gt; again;&lt;br&gt;
If it still does not work, restart adb via adb kill-server and try again from the beginning.&lt;/p&gt;

&lt;p&gt;Disconnect wireless connection&lt;br&gt;
command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb disconnect &amp;lt;device-ip-address&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Wireless connection (no need to use USB cable)
&lt;/h3&gt;

&lt;p&gt;Note: root permission is required.&lt;/p&gt;

&lt;p&gt;The previous section "Wireless connection (requires USB cable)" is the method introduced in the official document, which requires the help of USB data cable to achieve wireless connection.&lt;br&gt;
Since we want to achieve wireless connection, can all steps be wireless? The answer is yes.&lt;br&gt;
Install a terminal emulator on the Android device.&lt;br&gt;
Devices that have already been installed can skip this step. The download address of the terminal emulator I use is: Terminal Emulator for Android Downloads&lt;br&gt;
Connect the Android device and the computer to run adb to the same local area network, for example to the same WiFi.&lt;br&gt;
Open the terminal emulator on the Android device and run the commands in sequence:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

su
setprop service.adb.tcp.port 5555


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Find the IP address of the Android device.&lt;/p&gt;

&lt;p&gt;Generally, it can be found in "Settings"-"About Phone"-"Status Information"-"IP Address", or you can use the adb command to view it using the method in the section View Device Information-IP Address below.&lt;/p&gt;

&lt;p&gt;Connect the Android device via adb and IP address on the computer.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb connect &amp;lt;device-ip-address&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here  is the device IP address found in the previous step.&lt;/p&gt;

&lt;p&gt;If you can see the output connected to :5555, it means the connection is successful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section Note 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some devices, such as Xiaomi 5S + MIUI 8.0 + Android 6.0.1 MXB48T, may need to restart the adbd service before step 5, and run on the device's terminal emulator:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

restart adbd


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If restart does not work, try the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

stop adbd
start adbd


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Application Management
&lt;/h2&gt;
&lt;h3&gt;
  
  
  View application list
&lt;/h3&gt;

&lt;p&gt;The basic command format for viewing the application list is&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FILTER]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That is, on the basis of adb shell pm list packages, you can add some parameters to filter and view different lists. The supported filter parameters are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Display list&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;All applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-f&lt;/td&gt;
&lt;td&gt;Display the apk file associated with the application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-d&lt;/td&gt;
&lt;td&gt;Only display disabled apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-e&lt;/td&gt;
&lt;td&gt;Only show enabled apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-s&lt;/td&gt;
&lt;td&gt;Only show system apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-3&lt;/td&gt;
&lt;td&gt;Only display third-party applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-i&lt;/td&gt;
&lt;td&gt;Display the installer of the application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-u&lt;/td&gt;
&lt;td&gt;Include uninstalled apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;FILTER&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Package name contains &lt;code&gt;&amp;lt;FILTER&amp;gt;&lt;/code&gt; string&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  All applications
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm list packages


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

package:com.android.smoketest
package:com.example.android.livecubes
package:com.android.providers.telephony
package:com.google.android.googlequicksearchbox
package:com.android.providers.calendar
package:com.android.providers.media
package:com.android.protips
package:com.android.documentsui
package:com.android.gallery
package:com.android.externalstorage
...
// other packages here
...


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  system applications
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm list packages -s


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  third-party usage
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm list packages -3


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Applications whose package name contains a certain string&lt;br&gt;
For example, to view the list of applications whose package name contains the string mazhuang, command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm list packages mazhuang


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Of course, you can also use grep to filter:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm list packages | grep mazhuang


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Install APK
&lt;/h3&gt;

&lt;p&gt;Command format:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb install [-lrtsdg] &amp;lt;path_to_apk&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;parameter:&lt;/p&gt;

&lt;p&gt;Adb install can be followed by some optional parameters to control the behavior of installing APK. The available parameters and their meanings are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;-l&lt;/td&gt;
&lt;td&gt;Install the application to the protected directory /mnt/asec&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-r&lt;/td&gt;
&lt;td&gt;Allow overwrite installation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-t&lt;/td&gt;
&lt;td&gt;Allow to install the application specified by application &lt;code&gt;android:testOnly="true"&lt;/code&gt; in AndroidManifest.xml&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-s&lt;/td&gt;
&lt;td&gt;Install the application to the sdcard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-d&lt;/td&gt;
&lt;td&gt;Allow downgrade to overwrite installation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-g&lt;/td&gt;
&lt;td&gt;Grant all runtime permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;After running the command, if you see output similar to the following (the status is Success), the installation is successful:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[100%] /data/local/tmp/1.apk
pkg: /data/local/tmp/1.apk
Success


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above is the output of the latest version of adb of v1.0.36, which will show the progress percentage of pushing the apk file to the phone.&lt;/p&gt;

&lt;p&gt;Using the old version of adb, the output is like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

12040 KB/s (22205609 bytes in 1.801s)
        pkg: /data/local/tmp/SogouInput_android_v8.3_sweb.apk
Success


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And if the status is Failure, the installation failed, for example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[100%] /data/local/tmp/map-20160831.apk
        pkg: /data/local/tmp/map-20160831.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Common installation failure output codes, meanings and possible solutions are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Solution&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_ALREADY_EXISTS&lt;/td&gt;
&lt;td&gt;The application already exists, or uninstalled but not uninstalled cleanly&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;adb install&lt;/code&gt;, use the &lt;code&gt;-r&lt;/code&gt; parameter, or first &lt;code&gt;adb uninstall &amp;lt;packagename&amp;gt;&lt;/code&gt; and then install&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_INVALID_APK&lt;/td&gt;
&lt;td&gt;Invalid APK file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_INVALID_URI&lt;/td&gt;
&lt;td&gt;Invalid APK file name&lt;/td&gt;
&lt;td&gt;Make sure there is no Chinese in the APK file name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_INSUFFICIENT_STORAGE&lt;/td&gt;
&lt;td&gt;Not enough space&lt;/td&gt;
&lt;td&gt;Clean up space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_DUPLICATE_PACKAGE&lt;/td&gt;
&lt;td&gt;A program with the same name already exists&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_NO_SHARED_USER&lt;/td&gt;
&lt;td&gt;The requested shared user does not exist&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_UPDATE_INCOMPATIBLE&lt;/td&gt;
&lt;td&gt;The application with the same name has been installed before, but the data is not removed when uninstalling; or the application has been installed, but the signature is inconsistent&lt;/td&gt;
&lt;td&gt;First &lt;code&gt;adb uninstall &amp;lt;packagename&amp;gt;&lt;/code&gt; then install&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_SHARED_USER_INCOMPATIBLE&lt;/td&gt;
&lt;td&gt;The requested shared user exists but the signature is inconsistent&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_MISSING_SHARED_LIBRARY&lt;/td&gt;
&lt;td&gt;The installation package uses a shared library that is not available on the device&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_REPLACE_COULDNT_DELETE&lt;/td&gt;
&lt;td&gt;Cannot be deleted when replacing&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_DEXOPT&lt;/td&gt;
&lt;td&gt;dex optimization verification failed or insufficient space&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_OLDER_SDK&lt;/td&gt;
&lt;td&gt;The device system version is lower than the application requirements&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_CONFLICTING_PROVIDER&lt;/td&gt;
&lt;td&gt;A content provider with the same name as the app already exists in the device&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_NEWER_SDK&lt;/td&gt;
&lt;td&gt;The device system version is higher than the application requirements&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_TEST_ONLY&lt;/td&gt;
&lt;td&gt;The application is test-only, but the &lt;code&gt;-t&lt;/code&gt; parameter is not specified during installation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_CPU_ABI_INCOMPATIBLE&lt;/td&gt;
&lt;td&gt;Contains native code of incompatible device CPU application binary interface&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_MISSING_FEATURE&lt;/td&gt;
&lt;td&gt;The application uses a feature that is not available on the device&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_CONTAINER_ERROR&lt;/td&gt;
&lt;td&gt;1. sdcard access failed; &lt;br&gt;2. The application signature is consistent with the ROM signature and is regarded as a built-in application. &lt;/td&gt;
&lt;td&gt;1. Confirm that the sdcard is available, or install it to the built-in storage; &lt;br&gt;2. Do not use the same signature as the ROM when packaging. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_INVALID_INSTALL_LOCATION&lt;/td&gt;
&lt;td&gt;1. Cannot be installed to the specified location; &lt;br&gt;2. The application signature is consistent with the ROM signature and is regarded as a built-in application. &lt;/td&gt;
&lt;td&gt;1. Switch the installation location, add or delete the &lt;code&gt;-s&lt;/code&gt; parameter;&lt;br&gt;2. Do not use the same signature as the ROM when packaging. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_MEDIA_UNAVAILABLE&lt;/td&gt;
&lt;td&gt;The installation location is not available&lt;/td&gt;
&lt;td&gt;Usually sdcard, confirm that the sdcard is available or install to the built-in storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_VERIFICATION_TIMEOUT&lt;/td&gt;
&lt;td&gt;Verify installation package timeout&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_VERIFICATION_FAILURE&lt;/td&gt;
&lt;td&gt;Failed to verify the installation package&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_PACKAGE_CHANGED&lt;/td&gt;
&lt;td&gt;The application does not match the expectations of the calling program&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_UID_CHANGED&lt;/td&gt;
&lt;td&gt;The application has been installed before, and it is not consistent with the UID assigned this time&lt;/td&gt;
&lt;td&gt;Clean up residual files from previous installations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_VERSION_DOWNGRADE&lt;/td&gt;
&lt;td&gt;A newer version of this app has been installed&lt;/td&gt;
&lt;td&gt;Use the &lt;code&gt;-d&lt;/code&gt; parameter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE&lt;/td&gt;
&lt;td&gt;The installed target SDK supports the application of the same name with runtime permissions, and the version to be installed does not support runtime permissions&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_NOT_APK&lt;/td&gt;
&lt;td&gt;The specified path is not a file or does not end with &lt;code&gt;.apk&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_BAD_MANIFEST&lt;/td&gt;
&lt;td&gt;Unable to parse AndroidManifest.xml file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION&lt;/td&gt;
&lt;td&gt;The parser encountered an exception&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_NO_CERTIFICATES&lt;/td&gt;
&lt;td&gt;The installation package is not signed&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES&lt;/td&gt;
&lt;td&gt;The app has been installed, and the signature is inconsistent with the APK file&lt;/td&gt;
&lt;td&gt;Uninstall the app on the device first, then install it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CertificateEncodingException&lt;/code&gt;&lt;/td&gt; when parsing APK file
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME&lt;/td&gt;
&lt;td&gt;There is no or invalid package name in the manifest file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID&lt;/td&gt;
&lt;td&gt;An invalid shared user ID is specified in the manifest file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_MANIFEST_MALFORMED&lt;/td&gt;
&lt;td&gt;A structural error was encountered while parsing the manifest file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_PARSE_FAILED_MANIFEST_EMPTY&lt;/td&gt;
&lt;td&gt;The operable tag (instrumentation or application) could not be found in the manifest file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_INTERNAL_ERROR&lt;/td&gt;
&lt;td&gt;Installation failed due to system problems&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_USER_RESTRICTED&lt;/td&gt;
&lt;td&gt;Users are restricted from installing apps&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_DUPLICATE_PERMISSION&lt;/td&gt;
&lt;td&gt;The application tries to define an existing permission name&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_NO_MATCHING_ABIS&lt;/td&gt;
&lt;td&gt;The application contains native code not supported by the application binary interface of the device&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_CANCELED_BY_USER&lt;/td&gt;
&lt;td&gt;App installation needs to be confirmed on the device, but the device is not operated or canceled&lt;/td&gt;
&lt;td&gt;Agree to install on the device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INSTALL_FAILED_ACWF_INCOMPATIBLE&lt;/td&gt;
&lt;td&gt;The application is not compatible with the device&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;does not contain AndroidManifest.xml&lt;/td&gt;
&lt;td&gt;Invalid APK file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;is not a valid zip file&lt;/td&gt;
&lt;td&gt;Invalid APK file&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Offline&lt;/td&gt;
&lt;td&gt;The device is not connected successfully&lt;/td&gt;
&lt;td&gt;First connect the device to adb successfully&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;unauthorized&lt;/td&gt;
&lt;td&gt;The device is not authorized to allow debugging&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;error: device not found&lt;/td&gt;
&lt;td&gt;There is no successfully connected device&lt;/td&gt;
&lt;td&gt;First connect the device to adb successfully&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;protocol failure&lt;/td&gt;
&lt;td&gt;The device has been disconnected&lt;/td&gt;
&lt;td&gt;First connect the device to adb successfully&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unknown option: -s&lt;/td&gt;
&lt;td&gt;Installation to sdcard is not supported under Android 2.2&lt;/td&gt;
&lt;td&gt;Do not use the &lt;code&gt;-s&lt;/code&gt; parameter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No space left on device&lt;/td&gt;
&lt;td&gt;Not enough space&lt;/td&gt;
&lt;td&gt;Clean up space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Permission denied ... sdcard ...&lt;/td&gt;
&lt;td&gt;sdcard is not available&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;signatures do not match the previously installed version; ignoring!&lt;/td&gt;
&lt;td&gt;The app has been installed and the signatures are inconsistent&lt;/td&gt;
&lt;td&gt;Uninstall the app on the device first, then install it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Reference: &lt;a href="https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/content/pm/PackageManager.java" rel="noopener noreferrer"&gt;[PackageManager.java]&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adb install internal principle introduction
&lt;/h3&gt;

&lt;p&gt;adb install is actually completed in three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Push the apk file to /data/local/tmp.&lt;/li&gt;
&lt;li&gt;Call pm install to install.&lt;/li&gt;
&lt;li&gt;Delete the corresponding apk file under /data/local/tmp.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Therefore, when necessary, you can also follow this step to manually perform the installation process step by step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uninstall the app
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb uninstall [-k] &amp;lt;packagename&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; represents the package name of the application, and the -k parameter is optional, meaning that the application is uninstalled but the data and cache directory are retained.&lt;br&gt;
Command example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb uninstall com.qihoo360.mobilesafe


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Means to uninstall 360 Mobile Guard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clear application data and cache
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm clear &amp;lt;packagename&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; represents the application name package. The effect of this command is equivalent to clicking "Clear Cache" and "Clear Data" on the application information interface in the settings.&lt;/p&gt;

&lt;p&gt;Command example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell pm clear com.qihoo360.mobilesafe


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Means to clear the data and cache of 360 Mobile Guard.&lt;/p&gt;

&lt;h3&gt;
  
  
  View foreground activity
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys activity activities | grep mFocusedActivity


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mFocusedActivity: ActivityRecord{8079d7e u0 com.cyanogenmod.trebuchet/com.android.launcher3.Launcher t42}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Among them, &lt;code&gt;com.cyanogenmod.trebuchet/com.android.launcher3.Launcher&lt;/code&gt; is the Activity currently in the foreground.&lt;/p&gt;

&lt;h3&gt;
  
  
  View running Services
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys activity services [&amp;lt;packagename&amp;gt;]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; parameter is not necessary. Specifying &lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; means viewing the Services related to a certain package name, and not specifying it means viewing all Services.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; does not have to give a complete package name. For example, if you run adb shell dumpsys activity services org.mazhuang, then the package name org.mazhuang.demo1, org.mazhuang.demo2, org.mazhuang123 and other related Services will be listed come out.&lt;/p&gt;

&lt;h3&gt;
  
  
  View application details
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys package &amp;lt;packagename&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The output contains a lot of information, including Activity Resolver Table, Registered ContentProviders, package name, userId, path to file resource code after installation, version information, permission information and grant status, signature version information, etc.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; represents the application package name.&lt;/p&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Activity Resolver Table:
  Non-Data Actions:
      android.intent.action.MAIN:
        5b4cba8 org.mazhuang.guanggoo/.SplashActivity filter 5ec9dcc
          Action: "android.intent.action.MAIN"
          Category: "android.intent.category.LAUNCHER"
          AutoVerify=false

Registered ContentProviders:
  org.mazhuang.guanggoo/com.tencent.bugly.beta.utils.BuglyFileProvider:
    Provider{7a3c394 org.mazhuang.guanggoo/com.tencent.bugly.beta.utils.BuglyFileProvider}

ContentProvider Authorities:
  [org.mazhuang.guanggoo.fileProvider]:
    Provider{7a3c394 org.mazhuang.guanggoo/com.tencent.bugly.beta.utils.BuglyFileProvider}
      applicationInfo=ApplicationInfo{7754242 org.mazhuang.guanggoo}

Key Set Manager:
  [org.mazhuang.guanggoo]
      Signing KeySets: 501

Packages:
  Package [org.mazhuang.guanggoo] (c1d7f):
    userId=10394
    pkg=Package{55f714c org.mazhuang.guanggoo}
    codePath=/data/app/org.mazhuang.guanggoo-2
    resourcePath=/data/app/org.mazhuang.guanggoo-2
    legacyNativeLibraryDir=/data/app/org.mazhuang.guanggoo-2/lib
    primaryCpuAbi=null
    secondaryCpuAbi=null
    versionCode=74 minSdk=15 targetSdk=25
    versionName=1.1.74
    splits=[base]
    apkSigningVersion=2
    applicationInfo=ApplicationInfo{7754242 org.mazhuang.guanggoo}
    flags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP]
    privateFlags=[ RESIZEABLE_ACTIVITIES]
    dataDir=/data/user/0/org.mazhuang.guanggoo
    supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
    timeStamp=2017-10-22 23:50:53
    firstInstallTime=2017-10-22 23:50:25
    lastUpdateTime=2017-10-22 23:50:55
    installerPackageName=com.miui.packageinstaller
    signatures=PackageSignatures{af09595 [53c7caa2]}
    installPermissionsFixed=true installStatus=1
    pkgFlags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP]
    requested permissions:
      android.permission.READ_PHONE_STATE
      android.permission.INTERNET
      android.permission.ACCESS_NETWORK_STATE
      android.permission.ACCESS_WIFI_STATE
      android.permission.READ_LOGS
      android.permission.WRITE_EXTERNAL_STORAGE
      android.permission.READ_EXTERNAL_STORAGE
    install permissions:
      android.permission.INTERNET: granted=true
      android.permission.ACCESS_NETWORK_STATE: granted=true
      android.permission.ACCESS_WIFI_STATE: granted=true
    User 0: ceDataInode=1155675 installed=true hidden=false suspended=false stopped=true notLaunched=false enabled=0
      gids=[3003]
      runtime permissions:
        android.permission.READ_EXTERNAL_STORAGE: granted=true
        android.permission.READ_PHONE_STATE: granted=true
        android.permission.WRITE_EXTERNAL_STORAGE: granted=true
    User 999: ceDataInode=0 installed=false hidden=false suspended=false stopped=true notLaunched=true enabled=0
      gids=[3003]
      runtime permissions:


Dexopt state:
  [org.mazhuang.guanggoo]
    Instruction Set: arm64
      path: /data/app/org.mazhuang.guanggoo-2/base.apk
      status: /data/app/org.mazhuang.guanggoo-2/oat/arm64/base.odex [compilation_filter=speed-profile, status=kOatUpToDa
      te]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Interact with the application
&lt;/h2&gt;

&lt;p&gt;Mainly use the &lt;code&gt;am &amp;lt;command&amp;gt;&lt;/code&gt; command, the commonly used &lt;code&gt;&amp;lt;command&amp;gt;&lt;/code&gt; are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;command&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;start [options] &amp;lt;INTENT&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start the activity specified by &lt;code&gt;&amp;lt;INTENT&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;startservice [options] &amp;lt;INTENT&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start the service specified by &lt;code&gt;&amp;lt;INTENT&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;broadcast [options] &amp;lt;INTENT&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send the broadcast specified by &lt;code&gt;&amp;lt;INTENT&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;force-stop &amp;lt;packagename&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stop &lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt; related processes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;INTENT&amp;gt;&lt;/code&gt; The parameters are very flexible, and correspond to the Intent in the code when writing Android programs. &lt;/p&gt;

&lt;p&gt;The options used to determine the intent object are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-a &amp;lt;ACTION&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify the action, such as &lt;code&gt;android.intent.action.VIEW&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-c &amp;lt;CATEGORY&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify category, such as &lt;code&gt;android.intent.category.APP_CONTACTS&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-n &amp;lt;COMPONENT&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify the complete component name, which is used to clearly specify which Activity to start, such as &lt;code&gt;com.example.app/.ExampleActivity&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;INTENT&amp;gt;&lt;/code&gt; can also carry data, just like Bundle when writing code:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--esn &amp;lt;EXTRA_KEY&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;null value (only key name)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;`-e&lt;/td&gt;
&lt;td&gt;--es &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_STRING_VALUE&amp;gt;`&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ez &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_BOOLEAN_VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;boolean value&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ei &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_INT_VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;integer value&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--el &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_LONG_VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;long value&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ef &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_FLOAT_VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;float 值&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--eu &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_URI_VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;URI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ecn &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_COMPONENT_NAME_VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;component name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--eia &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_INT_VALUE&amp;gt;[,&amp;lt;EXTRA_INT_VALUE...]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;integer 数组&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ela &amp;lt;EXTRA_KEY&amp;gt; &amp;lt;EXTRA_LONG_VALUE&amp;gt;[,&amp;lt;EXTRA_LONG_VALUE...]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;long 数组&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Activating Activity
&lt;/h3&gt;

&lt;p&gt;Command format:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am start [options] &amp;lt;INTENT&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;E.g:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am start -n com.tencent.mm/.ui.LauncherUI


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Indicates that the main interface of WeChat is activated.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am start -n org.mazhuang.boottimemeasure/.MainActivity --es "toast" "hello, world"


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It means to call up org.mazhuang.boottimemeasure/.MainActivity and pass it the string data key-value pair toast-hello, world.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transfer Service
&lt;/h3&gt;

&lt;p&gt;Command format:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am startservice [options] &amp;lt;INTENT&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;E.g:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am startservice -n com.tencent.mm/.plugin.accountsync.model.AccountAuthenticatorService


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Indicates that a certain service of WeChat has been activated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Send broadcast
&lt;/h3&gt;

&lt;p&gt;Command format:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am broadcast [options] &amp;lt;INTENT&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It can be broadcast to all components or only to specified components.&lt;/p&gt;

&lt;p&gt;For example, to broadcast BOOT_COMPLETED to all components:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For another example, only broadcast BOOT_COMPLETED to org.mazhuang.boottimemeasure/.BootCompletedReceiver:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n org.mazhuang.boottimemeasure/.BootCompletedReceiver


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This type of usage is very practical when testing. For example, a broadcast scene is difficult to create. You can consider sending broadcasts in this way.&lt;br&gt;
It can send the pre-defined broadcast of the system and also send the self-defined broadcast. The following is part of the system predefined broadcast and normal trigger timing:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;action&lt;/th&gt;
&lt;th&gt;Trigger timing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;android.net.conn.CONNECTIVITY_CHANGE&lt;/td&gt;
&lt;td&gt;Network connection has changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.SCREEN_ON&lt;/td&gt;
&lt;td&gt;The screen lights up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.SCREEN_OFF&lt;/td&gt;
&lt;td&gt;The screen goes off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.BATTERY_LOW&lt;/td&gt;
&lt;td&gt;If the battery is low, a low battery prompt box will pop up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.BATTERY_OKAY&lt;/td&gt;
&lt;td&gt;The battery is restored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.BOOT_COMPLETED&lt;/td&gt;
&lt;td&gt;The device has started up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.DEVICE_STORAGE_LOW&lt;/td&gt;
&lt;td&gt;Storage space is too low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.DEVICE_STORAGE_OK&lt;/td&gt;
&lt;td&gt;Storage space recovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.PACKAGE_ADDED&lt;/td&gt;
&lt;td&gt;A new application is installed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.net.wifi.STATE_CHANGE&lt;/td&gt;
&lt;td&gt;The WiFi connection status has changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.net.wifi.WIFI_STATE_CHANGED&lt;/td&gt;
&lt;td&gt;WiFi status changes to enable/disable/starting/disabling/unknown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.BATTERY_CHANGED&lt;/td&gt;
&lt;td&gt;The battery level has changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.INPUT_METHOD_CHANGED&lt;/td&gt;
&lt;td&gt;The system input method has changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.ACTION_POWER_CONNECTED&lt;/td&gt;
&lt;td&gt;External power connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.ACTION_POWER_DISCONNECTED&lt;/td&gt;
&lt;td&gt;External power supply disconnected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.DREAMING_STARTED&lt;/td&gt;
&lt;td&gt;The system started to sleep&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.DREAMING_STOPPED&lt;/td&gt;
&lt;td&gt;The system stops sleeping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.WALLPAPER_CHANGED&lt;/td&gt;
&lt;td&gt;The wallpaper has changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.HEADSET_PLUG&lt;/td&gt;
&lt;td&gt;Plug in headphones&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.MEDIA_UNMOUNTED&lt;/td&gt;
&lt;td&gt;Unload external media&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.intent.action.MEDIA_MOUNTED&lt;/td&gt;
&lt;td&gt;Mount external media&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;android.os.action.POWER_SAVE_MODE_CHANGED&lt;/td&gt;
&lt;td&gt;Enable power saving mode&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;(The above broadcasts can all be triggered by adb)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Forcibly stop the application
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am force-stop &amp;lt;packagename&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Command example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell am force-stop com.qihoo360.mobilesafe


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Means to stop all the processes and services of 360 Security Guard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Disable apps and start
&lt;/h3&gt;

&lt;p&gt;Command example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;pm&lt;/span&gt; &lt;span class="n"&gt;disable&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;packagename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;pm&lt;/span&gt; &lt;span class="n"&gt;disable&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;packagename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;pm&lt;/span&gt; &lt;span class="n"&gt;disable&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;packagename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Command example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;pm&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;packagename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Revoke the permissions of the application
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Grant permissions to the app. Only optional permissions declared by the application can be granted&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;pm&lt;/span&gt; &lt;span class="n"&gt;grant&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;packagename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;PACKAGE_PERMISSION&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For example: &lt;code&gt;adb -d shell pm grant packageName android.permission.BATTERY_STATS&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cancel app authorization&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;pm&lt;/span&gt; &lt;span class="n"&gt;revoke&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;packagename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;PACKAGE_PERMISSION&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Option &lt;code&gt;--user user_id: the user to be disabled&lt;/code&gt; For example, grant permissions to the application. On devices running Android 6.0 (API level 23) and higher, the permission can be any permission declared in the application manifest. On devices running Android 5.1 (API level 22) and lower, it must be an optional permission defined by the application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Disclaimer: The above order is an unconventional order. I am not responsible for any damage to your equipment, forcible stop, etc. You are performing this operation on your device, and you are responsible for it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  File Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Copy the files in the device to the computer
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb pull &amp;lt;file path in device&amp;gt; [directory on computer]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Among them, the directory parameter on the computer can be omitted, and the default is copied to the current directory.&lt;/p&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb pull /sdcard/sr.mp4 ~/tmp/


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;*Tips: *The file path on the device may require root privileges to access. If your device has been rooted, you can use the adb shell and su commands to obtain root privileges in the adb shell, then cp /path/on/device /sdcard/filename Copy the file to sdcard, then adb pull /sdcard/filename /path/on/pc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Copy files from computer to device
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb push &amp;lt;file path on computer&amp;gt; &amp;lt;directory in device&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb push ~/sr.mp4 /sdcard/


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;*Tips: *The file path on the device may not be directly written by ordinary permissions. If your device has been rooted, you can first adb push /path/on/pc /sdcard/filename, and then adb shell and su in adb shell After obtaining root permissions, cp /sdcard/filename /path/on/device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simulation key/input
&lt;/h2&gt;

&lt;p&gt;There is a very useful command called input in adb shell, through which you can do some interesting things.&lt;br&gt;
The complete help information of the input command is as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Usage: input [&amp;lt;source&amp;gt;] &amp;lt;command&amp;gt; [&amp;lt;arg&amp;gt;...]

The sources are:
      mouse
      keyboard
      joystick
      touchnavigation
      touchpad
      trackball
      stylus
      dpad
      gesture
      touchscreen
      gamepad

The commands and default sources are:
      text &amp;lt;string&amp;gt; (Default: touchscreen)
      keyevent [--longpress] &amp;lt;key code number or name&amp;gt; ... (Default: keyboard)
      tap &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; (Default: touchscreen)
      swipe &amp;lt;x1&amp;gt; &amp;lt;y1&amp;gt; &amp;lt;x2&amp;gt; &amp;lt;y2&amp;gt; [duration(ms)] (Default: touchscreen)
      press (Default: trackball)
      roll &amp;lt;dx&amp;gt; &amp;lt;dy&amp;gt; (Default: trackball)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For example, to simulate a click: //Click the position of the coordinate point x=50 y=250 on the screen.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell input tap 50 250&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example, using the adb shell input keyevent  command, different keycodes can achieve different functions. For the complete keycode list, see KeyEvent. The excerpts are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;keycode&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;HOME key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Back key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Open the dial-up application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Hang up the call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;Increase volume&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;Reduce the volume&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;Power button&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;Taking photos (need to be in the camera application)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;Open the browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;82&lt;/td&gt;
&lt;td&gt;Menu key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;85&lt;/td&gt;
&lt;td&gt;Play/Pause&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;86&lt;/td&gt;
&lt;td&gt;Stop playing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;87&lt;/td&gt;
&lt;td&gt;Play the next song&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;88&lt;/td&gt;
&lt;td&gt;Play the previous song&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;122&lt;/td&gt;
&lt;td&gt;Move the cursor to the beginning of the line or the top of the list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;123&lt;/td&gt;
&lt;td&gt;Move the cursor to the end of the line or the bottom of the list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;126&lt;/td&gt;
&lt;td&gt;Resume playback&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;127&lt;/td&gt;
&lt;td&gt;Pause playback&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;164&lt;/td&gt;
&lt;td&gt;Mute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;176&lt;/td&gt;
&lt;td&gt;Open system settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;187&lt;/td&gt;
&lt;td&gt;Switch application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;207&lt;/td&gt;
&lt;td&gt;Open contacts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;208&lt;/td&gt;
&lt;td&gt;Open the calendar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;209&lt;/td&gt;
&lt;td&gt;Open music&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;210&lt;/td&gt;
&lt;td&gt;Open the calculator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;220&lt;/td&gt;
&lt;td&gt;Reduce screen brightness&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;221&lt;/td&gt;
&lt;td&gt;Increase screen brightness&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;223&lt;/td&gt;
&lt;td&gt;System hibernation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;224&lt;/td&gt;
&lt;td&gt;Light up the screen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;231&lt;/td&gt;
&lt;td&gt;Open the voice assistant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;276&lt;/td&gt;
&lt;td&gt;If there is no wakelock, let the system hibernate&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The following are some usage examples of input command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Power button
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

db shell input keyevent 26


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The effect is equivalent to pressing the power button.&lt;/p&gt;

&lt;h3&gt;
  
  
  menu
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 82


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  HOME key
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 3


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  return key
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 4


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  volume control
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Increase volume:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 24


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;lower the volume:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 25


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Mute:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 164


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Media Control
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;play / Pause:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 85


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Stop play:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 86


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Play the next song:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 87


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Play the previous song:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 88


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Resume playback:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 126


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Pause playback:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 127


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Turn on/off the screen
&lt;/h3&gt;

&lt;p&gt;The analog power button described above can be used to switch the screen on and off, but if you clearly want to turn on or off the screen, you can use the following method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Light up the screen:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 224


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Turn off the screen:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input keyevent 223


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Slide to unlock
&lt;/h3&gt;

&lt;p&gt;If the lock screen does not have a password and is unlocked by swiping gestures, you can unlock it by input swipe.&lt;/p&gt;

&lt;p&gt;Command (parameters are based on model Nexus 5, for example, swipe up gesture to unlock):&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input swipe 300 1000 300 500


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The parameters 300 1000 300 500 respectively represent the start point x coordinate, the start point y coordinate, the end point x coordinate, and the end point y coordinate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enter text
&lt;/h3&gt;

&lt;p&gt;When the focus is on a text box, you can use the input command to enter text.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell input text hello


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now hello appears in the text box.&lt;/p&gt;

&lt;h2&gt;
  
  
  View log
&lt;/h2&gt;

&lt;p&gt;The Android system log is divided into two parts, the underlying Linux kernel log is output to /proc/kmsg, and the Android log is output to /dev/log.&lt;/p&gt;

&lt;h3&gt;
  
  
  Android log
&lt;/h3&gt;

&lt;p&gt;Command format:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[adb] logcat [&amp;lt;option&amp;gt;] ... [&amp;lt;filter-spec&amp;gt;] ...


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Common usages are listed as follows:&lt;/p&gt;

&lt;p&gt;Filter logs by level&lt;/p&gt;

&lt;p&gt;Android logs are divided into the following priority (priority):&lt;/p&gt;

&lt;p&gt;-V —— Verbose (lowest, most output)&lt;br&gt;
 -D —— Debug I —— Info&lt;br&gt;
 -W —— Warning&lt;br&gt;
 -E —— Error&lt;br&gt;
 -F—— Fatal&lt;br&gt;
 -S —— Silent (the highest, nothing is output)&lt;/p&gt;

&lt;p&gt;Filtering logs by a certain level will output logs of that level and above.&lt;/p&gt;

&lt;p&gt;For example, the command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb logcat *:W


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Warning, Error, Fatal and Silent logs will be output.&lt;/p&gt;

&lt;p&gt;(Note: Under macOS, you need to add double quotation marks to &lt;em&gt;:W so that * as the tag parameter, such as adb logcat "&lt;/em&gt;:W", otherwise an error will be reported no matches found: *:W.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter logs by tag and level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;filter-spec&amp;gt;&lt;/code&gt; can be composed of multiple &lt;code&gt;&amp;lt;tag&amp;gt;[:priority]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, the command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb logcat ActivityManager:I MyApp:D *:S


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It means to output the log above Info of tag ActivityManager, output the log above Debug of tag MyApp, and the Silent log of other tags (that is, to block other tag logs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Log Format&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can use the &lt;code&gt;adb logcat -v &amp;lt;format&amp;gt;&lt;/code&gt; option to specify the log output format.&lt;/p&gt;

&lt;p&gt;The log supports the following types of &lt;code&gt;&amp;lt;format&amp;gt;&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;-brief&lt;/p&gt;

&lt;p&gt;The default format. The format is:&lt;/p&gt;

&lt;p&gt;/(): &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;D/HeadsetStateMachine( 1785): Disconnected process message: 10, size: 0&lt;/p&gt;

&lt;p&gt;-process&lt;/p&gt;

&lt;p&gt;The format is:&lt;/p&gt;

&lt;p&gt;() &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;D( 1785) Disconnected process message: 10, size: 0 (HeadsetStateMachine)&lt;/p&gt;

&lt;p&gt;-tag&lt;/p&gt;

&lt;p&gt;The format is:&lt;/p&gt;

&lt;p&gt;/: &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;D/HeadsetStateMachine: Disconnected process message: 10, size: 0&lt;br&gt;
To&lt;br&gt;
 -raw&lt;/p&gt;

&lt;p&gt;The format is:&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;Disconnected process message: 10, size: 0&lt;/p&gt;

&lt;p&gt;-time&lt;/p&gt;

&lt;p&gt;The format is:&lt;/p&gt;

&lt;p&gt; /(): &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;08-28 22:39:39.974 D/HeadsetStateMachine( 1785): Disconnected process message: 10, size: 0&lt;/p&gt;

&lt;p&gt;-threadtime&lt;/p&gt;

&lt;p&gt;The format is:&lt;/p&gt;

&lt;p&gt;    : &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;08-28 22:39:39.974 1785 1832 D HeadsetStateMachine: Disconnected process message: 10, size: 0&lt;/p&gt;

&lt;p&gt;-long&lt;/p&gt;

&lt;p&gt;The format is:&lt;/p&gt;

&lt;p&gt;[ : /] &lt;br&gt;
  Example:&lt;/p&gt;

&lt;p&gt;[08-28 22:39:39.974 1785: 1832 D/HeadsetStateMachine] Disconnected process message: 10, size: 0&lt;/p&gt;

&lt;p&gt;The specified format can be used simultaneously with the above filtering. such as:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb logcat -v long ActivityManager:I *:S


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Clear log&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb logcat -c


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Kernel log
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dmesg


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;6&amp;gt;[14201.684016] PM: noirq resume of devices complete after 0.982 msecs
&amp;lt;6&amp;gt;[14201.685525] PM: early resume of devices complete after 0.838 msecs
&amp;lt;6&amp;gt;[14201.753642] PM: resume of devices complete after 68.106 msecs
&amp;lt;4&amp;gt;[14201.755954] Restarting tasks ... done.
&amp;lt;6&amp;gt;[14201.771229] PM: suspend exit 2016-08-28 13:31:32.679217193 UTC
&amp;lt;6&amp;gt;[14201.872373] PM: suspend entry 2016-08-28 13:31:32.780363596 UTC
&amp;lt;6&amp;gt;[14201.872498] PM: Syncing filesystems ... done.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The [14201.684016] in the brackets represents the time since the kernel started, in seconds.&lt;/p&gt;

&lt;p&gt;Through the kernel log we can do some things, such as measuring the kernel startup time, find the time before the Freeing init memory line in the kernel log after the system is started.&lt;/p&gt;

&lt;h2&gt;
  
  
  View device information
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Model
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell getprop ro.product.model


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;p&gt;Nexus 5&lt;/p&gt;

&lt;h3&gt;
  
  
  Battery status
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys battery


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Input example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

  Current Battery Service state:
  AC powered: false
  USB powered: true
  Wireless powered: false
  status: 2
  health: 2
  present: true
  level: 44
  scale: 100
  voltage: 3872
  temperature: 280
  technology: Li-poly


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Among them, scale represents the maximum power, and level represents the current power. The output above indicates that 44% of the battery is left.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screen Resolution
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm size


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Physical size: 1080x1920


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The device screen resolution is 1080px * 1920px.&lt;/p&gt;

&lt;p&gt;If it is modified using the command, the output may be:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Physical size: 1080x1920
Override size: 480x1024


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Indicates that the screen resolution of the device was originally 1080px * 1920px, but is currently modified to 480px * 1024px.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screen density
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;p&gt;adb shell wm density&lt;br&gt;
Sample output:&lt;/p&gt;

&lt;p&gt;Physical density: 420&lt;br&gt;
The device screen density is 420dpi.&lt;/p&gt;

&lt;p&gt;If it is modified using the command, the output may be:&lt;/p&gt;

&lt;p&gt;Physical density: 480&lt;br&gt;
Override density: 160&lt;br&gt;
Indicates that the screen density of the device was originally 480dpi, but is currently modified to 160dpi.&lt;/p&gt;

&lt;h3&gt;
  
  
  Display parameters
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys window displays


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

WINDOW MANAGER DISPLAY CONTENTS (dumpsys window displays)
  Display: mDisplayId=0
    init=1080x1920 420dpi cur=1080x1920 app=1080x1794 rng=1080x1017-1810x1731
    deferred=false layoutNeeded=false


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Among them, mDisplayId is the display number, init is the initial resolution and screen density. The height of the app is smaller than that in init, which means that there are virtual buttons at the bottom of the screen. The height is 1920-1794 = 126px and 42dp.&lt;/p&gt;

&lt;h3&gt;
  
  
  android_id
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell settings get secure android_id


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

51b6be48bac8c569


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  IMEI
&lt;/h3&gt;

&lt;p&gt;In Android 4.4 and below versions, IMEI can be obtained by the following command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys iphonesubinfo


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Phone Subscriber Info:
  Phone Type = GSM
  Device ID = 860955027785041
The Device ID is IMEI.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In Android 5.0 and above, the output of this command is empty, and it must be obtained by other means (root permission is required):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell
su
service call iphonesubinfo 1


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Result: Parcel(
  0x00000000: 00000000 0000000f 00360038 00390030'........8.6.0.9.'
  0x00000010: 00350035 00320030 00370037 00350038 '5.5.0.2.7.7.8.5.'
  0x00000020: 00340030 00000031 '0.4.1...')


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Extracting the effective content inside is the IMEI, for example, here is 860955027785041.&lt;/p&gt;

&lt;p&gt;Reference: adb shell dumpsys iphonesubinfo not working since Android 5.0 Lollipop&lt;/p&gt;

&lt;h3&gt;
  
  
  Android system version
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell getprop ro.build.version.release


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;p&gt;5.0.2&lt;/p&gt;

&lt;h3&gt;
  
  
  IP address
&lt;/h3&gt;

&lt;p&gt;Every time you want to know the IP address of the device, you have to "Settings"-"About Phone"-"Status Information"-"IP Address", which is annoying, right? It can be easily viewed through adb.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell ifconfig "| grep Mask"


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

inet addr:10.130.245.230 Mask:255.255.255.252
inet addr: 127.0.0.1 Mask: 255.0.0.0


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then 10.130.245.230 is the device IP address.&lt;/p&gt;

&lt;p&gt;This command has no output on some devices. If the device is connected to WiFi, you can use the following command to view the local area network adb shell ifconfig wlan0 Example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

wlan0: ip 10.129.160.99 mask 255.255.240.0 flags [up broadcast running multicast]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

wlan0 Link encap:UNSPEC
          inet addr:10.129.168.57 Bcast:10.129.175.255 Mask:255.255.240.0
          inet6 addr: fe80::66cc:2eff:fe68:b6b6/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:496520 errors:0 dropped:0 overruns:0 frame:0
          TX packets: 68215 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000
          RX bytes: 116266821 TX bytes: 8311736


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If the above command still does not get the expected information, you can try the following command (available in some system versions):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell netcfg


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

wlan0 UP 10.129.160.99/20 0x00001043 f8:a9:d0:17:42:4d
lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
p2p0 UP 0.0.0.0/0 0x00001003 fa:a9:d0:17:42:4d
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
rmnet0 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet1 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet3 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet2 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet4 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet6 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet5 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rmnet7 DOWN 0.0.0.0/0 0x00000000 00:00:00:00:00:00
rev_rmnet3 DOWN 0.0.0.0/0 0x00001002 4e:b7:e4:2e:17:58
rev_rmnet2 DOWN 0.0.0.0/0 0x00001002 4e:f0:c8:bf:7a:cf
rev_rmnet4 DOWN 0.0.0.0/0 0x00001002 a6:c0:3b:6b:c4:1f
rev_rmnet6 DOWN 0.0.0.0/0 0x00001002 66:bb:5d:64:2e:e9
rev_rmnet5 DOWN 0.0.0.0/0 0x00001002 0e:1b:eb:b9:23:a0
rev_rmnet7 DOWN 0.0.0.0/0 0x00001002 7a:d9:f6:81:40:5a
rev_rmnet8 DOWN 0.0.0.0/0 0x00001002 4e:e2:a9:bb:d0:1b
rev_rmnet0 DOWN 0.0.0.0/0 0x00001002 fe:65:d0:ca:82:a9
rev_rmnet1 DOWN 0.0.0.0/0 0x00001002 da:d8:e8:4f:2e:fe


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can see information such as the network connection name, activation status, IP address, and Mac address.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mac address
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell cat /sys/class/net/wlan0/address


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

f8:a9:d0:17:42:4d


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is the local area network Mac address, mobile network or other connection information can be viewed through the adb shell netcfg command mentioned in the previous section "IP address".&lt;/p&gt;

&lt;h3&gt;
  
  
  CPU information
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell cat /proc/cpuinfo


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Processor: ARMv7 Processor rev 0 (v7l)
processor: 0
BogoMIPS: 38.40

processor: 1
BogoMIPS: 38.40

processor: 2
BogoMIPS: 38.40

processor: 3
BogoMIPS: 38.40

Features: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer: 0x51
CPU architecture: 7
CPU variant: 0x2
CPU part: 0x06f
CPU revision: 0

Hardware: Qualcomm MSM 8974 HAMMERHEAD (Flattened Device Tree)
Revision: 000b
Serial: 0000000000000000


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is the CPU information of Nexus 5. We can see from the output that the hardware used is Qualcomm MSM 8974, and the processor number is 0 to 3, so it is quad-core and the architecture used is ARMv7 Processor rev 0 (v71).&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory information
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell cat /proc/meminfo


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

MemTotal: 1027424 kB
MemFree: 486564 kB
Buffers: 15224 kB
Cached: 72464 kB
SwapCached: 24152 kB
Active: 110572 kB
Inactive: 259060 kB
Active(anon): 79176 kB
Inactive(anon): 207736 kB
Active(file): 31396 kB
Inactive(file): 51324 kB
Unevictable: 3948 kB
Mlocked: 0 kB
HighTotal: 409600 kB
HighFree: 132612 kB
LowTotal: 617824 kB
LowFree: 353952 kB
SwapTotal: 262140 kB
SwapFree: 207572 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 265324 kB
Mapped: 47072 kB
Shmem: 1020 kB
Slab: 57372 kB
SReclaimable: 7692 kB
SUnreclaim: 49680 kB
KernelStack: 4512 kB
PageTables: 5912 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 775852 kB
Committed_AS: 13520632 kB
VmallocTotal: 385024 kB
VmallocUsed: 61004 kB
VmallocChunk: 209668 kB


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Among them, MemTotal is the total memory of the device, and MemFree is the current free memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  More hardware and system properties
&lt;/h3&gt;

&lt;p&gt;More hardware and system properties of the device can be viewed through the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell cat /system/build.prop


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will output a lot of information, including the "model" and "Android system version" mentioned in the previous sections.&lt;/p&gt;

&lt;p&gt;The output also includes some other useful information, which can also be viewed separately through the adb shell getprop  command. Some properties are listed as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute name&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ro.build.version.sdk&lt;/td&gt;
&lt;td&gt;SDK version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.build.version.release&lt;/td&gt;
&lt;td&gt;Android system version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.build.version.security_patch&lt;/td&gt;
&lt;td&gt;Android security patch level&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.product.model&lt;/td&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.product.brand&lt;/td&gt;
&lt;td&gt;Brand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.product.name&lt;/td&gt;
&lt;td&gt;Device name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.product.board&lt;/td&gt;
&lt;td&gt;Processor model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.product.cpu.abilist&lt;/td&gt;
&lt;td&gt;Abi list supported by CPU [&lt;em&gt;Section 1&lt;/em&gt;]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;persist.sys.isUsbOtgEnabled&lt;/td&gt;
&lt;td&gt;Whether to support OTG&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dalvik.vm.heapsize&lt;/td&gt;
&lt;td&gt;Maximum memory limit for each application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ro.sf.lcd_density&lt;/td&gt;
&lt;td&gt;Screen density&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Section Note 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some ROMs customized by small factories may have modified the attribute name of the abi list supported by the CPU. If you can’t find it with the ro.product.cpu.abilist attribute name, you can try:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell cat /system/build.prop | grep ro.product.cpu.abi


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Modify settings
&lt;/h2&gt;

&lt;p&gt;*Note: After modifying the settings, running the recovery command may still display abnormalities. You can run adb reboot to restart the device, or manually restart. *&lt;/p&gt;

&lt;p&gt;The principle of modifying settings is mainly to modify the setting values ​​stored in /data/data/com.android.providers.settings/databases/settings.db through the settings command.&lt;/p&gt;
&lt;h3&gt;
  
  
  Resolution
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm size 480x1024


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Means to modify the resolution to 480px * 1024px.&lt;/p&gt;

&lt;p&gt;Restore the original resolution command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm size reset


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Screen density
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm density 160


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Means to modify the screen density to 160dpi.&lt;/p&gt;

&lt;p&gt;Restore the original screen density command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm density reset


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Display area
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm overscan 0,0,0,200


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The four numbers respectively indicate the margin pixels from the left, top, right, and bottom edges. The above command means to leave the bottom of the screen 200px blank.&lt;/p&gt;

&lt;p&gt;Restore the original display area command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell wm overscan reset


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Turn off USB debugging mode
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;p&gt;adb shell settings put global adb_enabled 0&lt;br&gt;
restore:&lt;/p&gt;

&lt;p&gt;It can't be restored with commands, after all, if USB debugging is turned off, adb cannot connect to the Android device.&lt;/p&gt;

&lt;p&gt;Go to the device to manually restore it: "Settings"-"Developer Options"-"Android Debugging".&lt;/p&gt;
&lt;h3&gt;
  
  
  Display and hide status bar and navigation bar
&lt;/h3&gt;

&lt;p&gt;The related settings mentioned in this section correspond to "Extended Desktop" in Cyanogenmod.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell settings put global policy_control &amp;lt;key-values&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;key-values&amp;gt;&lt;/code&gt; can be composed of the following keys and their corresponding values, in the format of &lt;code&gt;&amp;lt;key1&amp;gt;=&amp;lt;value1&amp;gt;:&amp;lt;key2&amp;gt;=&amp;lt;value2&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;key&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;immersive.full&lt;/td&gt;
&lt;td&gt;Hide at the same time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;immersive.status&lt;/td&gt;
&lt;td&gt;Hide the status bar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;immersive.navigation&lt;/td&gt;
&lt;td&gt;Hide the navigation bar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;immersive.preconfirms&lt;/td&gt;
&lt;td&gt;?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The values ​​corresponding to these keys can be combined with commas as the following values:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;value&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apps&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All interfaces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;packagename&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-packagename&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Exclude specific applications&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;E.g:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell settings put global policy_control immersive.full=*


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Indicates that the status bar and navigation bar are hidden at the same time in all interfaces.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell settings put global policy_control immersive.status=com.package1,com.package2:immersive.navigation=apps,-com.package3


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It means setting to hide the status bar in applications with package names com.package1 and com.package2, and hide the navigation bar in all applications except package names com.package3.&lt;/p&gt;

&lt;h3&gt;
  
  
  Return to normal mode
&lt;/h3&gt;

&lt;p&gt;What if I don't want to be full screen?&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell settings put global policy_control null


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Useful functions
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Save screenshot to computer:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb exec-out screencap -p&amp;gt; sc.png


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If the adb version is older and the exec-out command cannot be used, it is recommended to update the adb version at this time. If you cannot update, you can use the following troublesome methods:&lt;/p&gt;

&lt;p&gt;First save the screenshot to the device:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell screencap -p /sdcard/sc.png


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then export the png file to the computer:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb pull /sdcard/sc.png


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can use adb shell screencap -h to view the help information of the screencap command. The following are two meaningful parameters and their meanings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;-p&lt;/td&gt;
&lt;td&gt;Specify the save file as png format&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-d display-id&lt;/td&gt;
&lt;td&gt;Specify the screen number of the screenshot (if there are multiple screens)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Actually, if the specified file name ends with .png, you can omit the -p parameter; otherwise, you need to use the -p parameter. If you do not specify the file name, the content of the screenshot file will be directly output to stdout.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Another way to take a screenshot of a one-line command and save it to the computer:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Linux and Windows&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell screencap -p | sed "s/\r$//"&amp;gt; sc.png


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Mac OS X&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell screencap -p | gsed "s/\r$//"&amp;gt; sc.png


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This method needs to use the gnu sed command, which is available directly under Linux, and under the bin folder of the Git installation directory under Windows. If you really cannot find the command, you can download sed for Windows and add the folder where sed.exe is located to the PATH environment variable.&lt;/p&gt;

&lt;p&gt;However, using the sed command that comes with the system under Mac will report an error:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sed: RE error: illegal byte sequence


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Need to install gnu-sed, and then use the gsed command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

brew install gnu-sed


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Record screen
&lt;/h3&gt;

&lt;p&gt;The recorded screen is saved to /sdcard in mp4 format:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell screenrecord /sdcard/filename.mp4


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Press Ctrl-C when you need to stop, the default recording time and maximum recording time are both 180 seconds.&lt;/p&gt;

&lt;p&gt;If you need to export to a computer:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb pull /sdcard/filename.mp4


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can use adb shell screenrecord --help to view the help information of the screenrecord command. The following are common parameters and their meanings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;--size WIDTHxHEIGHT&lt;/td&gt;
&lt;td&gt;The size of the video, such as &lt;code&gt;1280x720&lt;/code&gt;, the default is the screen resolution. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;--bit-rate RATE&lt;/td&gt;
&lt;td&gt; The bit rate of the video, the default is 4Mbps. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;--time-limit TIME&lt;/td&gt;
&lt;td&gt; Recording duration, in seconds. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;--verbose&lt;/td&gt;
&lt;td&gt; Output more information. &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Remount the system partition as writable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;*Note: root permission is required. *&lt;/p&gt;

&lt;p&gt;The /system partition is mounted as read-only by default, but some operations such as adding commands to the Android system, deleting its own applications, etc. require writing to /system, so you need to remount it as read-write.&lt;/p&gt;

&lt;p&gt;step:&lt;/p&gt;

&lt;p&gt;Enter the shell and switch to root user authority.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell
su


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;View the current partition mounting status.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mount


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

rootfs / rootfs ro, relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /var tmpfs rw,seclabel,relatime,mode=770,gid=1000 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
none /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
none /dev/memcg cgroup rw,relatime,memory 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
none /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0
none /sys/fs/cgroup/freezer cgroup rw,relatime,freezer 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,relatime,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage =cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/shell/emulated/0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Find the line with /system that we are concerned about:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Remount.
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mount -o remount,rw -t yaffs2 /dev/block/platform/msm_sdcc.1/by-name/system /system


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here /dev/block/platform/msm_sdcc.1/by-name/system is the file path we got from the output of the previous step.&lt;/p&gt;

&lt;p&gt;If the output does not prompt an error, the operation is successful, and you can do whatever you want with the files under /system.&lt;/p&gt;

&lt;h3&gt;
  
  
  View connected WiFi passwords
&lt;/h3&gt;

&lt;p&gt;*Note: root permission is required. *&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell
su
cat /data/misc/wifi/*.conf


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

network={
ssid="TP-LINK_9DFC"
scan_ssid=1
psk="123456789"
key_mgmt=WPA-PSK
group=CCMP TKIP
auth_alg=OPEN
sim_num=1
priority=13893
}

network={
ssid="TP-LINK_F11E"
psk="987654321"
key_mgmt=WPA-PSK
sim_num=1
priority=17293
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;ssid is the name we see in the WLAN settings, psk is the password, and key_mgmt is the security encryption method.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set the system date and time
&lt;/h3&gt;

&lt;p&gt;*Note: root permission is required. *&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell
su
date -s 20160823.131500


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Means to change the system date and time to 13:15:00 on August 23, 2016.&lt;/p&gt;

&lt;h3&gt;
  
  
  restart cellphone
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb reboot


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Check if the device is rooted
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell
su


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;At this time, the command line prompt is $, which means that there is no root authority, and # means that it is rooted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Monkey for stress testing
&lt;/h3&gt;

&lt;p&gt;Monkey can generate pseudo-random user events to simulate clicks, touches, gestures and other operations, and can perform random stress tests on programs under development.&lt;/p&gt;

&lt;p&gt;Simple usage:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell monkey -p &amp;lt;packagename&amp;gt; -v 500


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It means to send 500 pseudo-random events to the application specified by &lt;code&gt;&amp;lt;packagename&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For detailed usage of Monkey, refer to the official documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Turn on/off WiFi
&lt;/h3&gt;

&lt;p&gt;Note: root permission is required.&lt;/p&gt;

&lt;p&gt;Sometimes you need to control the WiFi status of the device, you can use the following commands to complete.&lt;/p&gt;

&lt;p&gt;Turn on WiFi:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb root
adb shell svc wifi enable


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Turn off WiFi:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb root
adb shell svc wifi disable


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Set wifi priority, use wifi first when there is network and wifi&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;svc&lt;/span&gt; &lt;span class="n"&gt;wifi&lt;/span&gt; &lt;span class="n"&gt;prefer&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If the execution is successful, the output will be empty; if the command is executed without root permission, the execution will fail and the output will be Killed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Turn on/off data traffic
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;svc&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="n"&gt;disable&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command can close the data connection, that is, the Internet traffic. Everyone knows that there are many switches to control the Internet, but most of them are realized by adding a suffix to the access point on the apn, but this command will not change any settings of the apn. The bottom layer closes the data connection. It should be the most thorough, and does not affect the apn settings. What is the difference between this and apndroid? When apndroid closes the Internet data, the downloading connection may not be forcibly closed (this is also mentioned in apndroid's own instructions). For example, if you are downloading a 10M movie, if you download 1M, the download will not sound. Use apndroid to close the connection, maybe the download will continue, not immediately. But with this command, it clicked away without mercy.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;svc&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is to open the Internet data connection, which is the opposite of the previous command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;svc&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="n"&gt;prefer&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command is to control the data connection prior to wifi. We all know that under normal circumstances, when there is wifi, the data network connection will not be used. But this command is the opposite. If there is a data network, use data network traffic first, and use wifi when there is no data network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flashing related commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Restart to Recovery mode
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb reboot recovery


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Restart from Recovery to Android
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb reboot


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Restart to Fastboot mode
&lt;/h3&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb reboot bootloader


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Update the system via sideload
&lt;/h3&gt;

&lt;p&gt;If we download the system update package corresponding to the Android device to the computer, we can also complete the update through adb.&lt;/p&gt;

&lt;p&gt;Take the update in Recovery mode as an example:&lt;/p&gt;

&lt;p&gt;Restart to Recovery mode.&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb reboot recovery


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Operate on the Recovery interface of the device to enter Apply update-Apply from ADB.&lt;/p&gt;

&lt;p&gt;*Note: Different Recovery menus may be different from this. Some first-level menus have Apply update from ADB. *&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Upload and update the system via adb. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb sideload &amp;lt;path-to-update.zip&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  More adb shell commands
&lt;/h3&gt;

&lt;p&gt;The Android system is based on the Linux kernel, so many commands in Linux have the same or similar implementations in Android and can be called in adb shell. The adb shell command has been used in the previous part of this document.&lt;/p&gt;
&lt;h3&gt;
  
  
  View process
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell ps


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

USER PID PPID VSIZE RSS WCHAN PC NAME
root 1 0 8904 788 ffffffff 00000000 S /init
root 2 0 0 0 ffffffff 00000000 S kthreadd
...
u0_a71 7779 5926 1538748 48896 ffffffff 00000000 S com.sohu.inputmethod.sogou:classic
u0_a58 7963 5926 1561916 59568 ffffffff 00000000 S org.mazhuang.boottimemeasure
...
shell 8750 217 10640 740 00000000 b6f28340 R ps


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Meaning of each column:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column name&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;USER&lt;/td&gt;
&lt;td&gt;Owned user&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PID&lt;/td&gt;
&lt;td&gt;Process ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PPID&lt;/td&gt;
&lt;td&gt;Parent process ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAME&lt;/td&gt;
&lt;td&gt;Process name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  View real-time resource usage
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell top


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

User 0%, System 6%, IOW 0%, IRQ 0%
User 3 + Nice 0 + Sys 21 + Idle 280 + IOW 0 + IRQ 0 + SIRQ 3 = 307

  PID PR CPU% S #THR VSS RSS PCY UID Name
 8763 0 3% R 1 10640K 1064K fg shell top
  131 0 3% S 1 0K 0K fg root dhd_dpc
 6144 0 0% S 115 1682004K 115916K fg system system_server
  132 0 0% S 1 0K 0K fg root dhd_rxf
 1731 0 0% S 6 20288K 788K fg root /system/bin/mpdecision
  217 0 0% S 6 18008K 356K fg shell /sbin/adbd
 ...
 7779 2 0% S 19 1538748K 48896K bg u0_a71 com.sohu.inputmethod.sogou:classic
 7963 0 0% S 18 1561916K 59568K fg u0_a58 org.mazhuang.boottimemeasure
 ...


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Meaning of each column:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column name&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PID&lt;/td&gt;
&lt;td&gt;Process ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PR&lt;/td&gt;
&lt;td&gt;Priority&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU%&lt;/td&gt;
&lt;td&gt;The percentage of CPU occupied at the current instant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S&lt;/td&gt;
&lt;td&gt;Process status (R=run, S=sleep, T=track/stop, Z=zombie process)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;#THR&lt;/td&gt;
&lt;td&gt;Number of threads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VSS&lt;/td&gt;
&lt;td&gt;Virtual Set Size virtual memory consumption (including memory occupied by shared libraries)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RSS&lt;/td&gt;
&lt;td&gt;Resident Set Size actually uses physical memory (including memory occupied by shared libraries)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PCY&lt;/td&gt;
&lt;td&gt;Scheduling strategy priority, SP_BACKGROUND/SPFOREGROUND&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UID&lt;/td&gt;
&lt;td&gt;User ID of the process owner&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAME&lt;/td&gt;
&lt;td&gt;Process name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The top command also supports some command line parameters, the detailed usage is as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Usage: top [-m max_procs] [-n iterations] [-d delay] [-s sort_column] [-t] [-h]
    -m num shows how many processes at most
    -n num exit after refreshing how many times
    -d num refresh interval (unit: second, default value 5)
    -s col Sort by a column (available col values: cpu, vss, rss, thr)
    -t display thread information
    -h show help document


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  View process UID
&lt;/h3&gt;

&lt;p&gt;There are two options:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

adb shell dumpsys package &amp;lt;packagename&amp;gt; | grep userId=


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Such as:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ adb shell dumpsys package org.mazhuang.guanggoo | grep userId=
   userId=10394


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After finding the pid of the corresponding process through the ps command, &lt;code&gt;adb shell cat /proc/&amp;lt;pid&amp;gt;/status | grep Uid&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Such as:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ adb shell
gemini:/ $ ps | grep org.mazhuang.guanggoo
u0_a394 28635 770 1795812 78736 SyS_epoll_ 0000000000 S org.mazhuang.guanggoo
gemini:/$ cat /proc/28635/status | grep Uid
Uid: 10394 10394 10394 10394
gemini:/$


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Other
&lt;/h3&gt;

&lt;p&gt;The following is a brief description of other commonly used commands. The commands that have been specifically mentioned above will not be explained separately:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Features&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;cat&lt;/td&gt;
&lt;td&gt;Display file content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cd&lt;/td&gt;
&lt;td&gt;Change directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;chmod&lt;/td&gt;
&lt;td&gt;Change file access mode/access permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;df&lt;/td&gt;
&lt;td&gt;Check disk space usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;grep&lt;/td&gt;
&lt;td&gt;Filter output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kill&lt;/td&gt;
&lt;td&gt;Kill the process of the specified PID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ls&lt;/td&gt;
&lt;td&gt;List the contents of the directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mount&lt;/td&gt;
&lt;td&gt;View and manage mount directories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mv&lt;/td&gt;
&lt;td&gt;Move or rename files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ps&lt;/td&gt;
&lt;td&gt;View the running process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rm&lt;/td&gt;
&lt;td&gt;Delete files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;top&lt;/td&gt;
&lt;td&gt;Check the resource usage of the process&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Security related
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Enable SELinux
&lt;/h3&gt;

&lt;p&gt;Enable SELinux&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;
&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;setenforce&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Disable SELinux
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;
&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt; &lt;span class="n"&gt;setenforce&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Enable dm_verity
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;
&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;verity&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Disable dm_verity
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;
&lt;span class="n"&gt;adb&lt;/span&gt; &lt;span class="n"&gt;disable&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;verity&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  common problem
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Failed to start adb server
&lt;/h3&gt;

&lt;p&gt;Error message&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

error: protocol fault (couldn't read status): No error


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;possible reason&lt;/p&gt;

&lt;p&gt;The 5037 port that the adb server process wants to use is occupied.&lt;/p&gt;

&lt;p&gt;solution&lt;/p&gt;

&lt;p&gt;Find the process occupying port 5037, and then terminate it. Take Windows as an example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

netstat -ano | findstr LISTENING

...
TCP 0.0.0.0:5037 0.0.0.0:0 LISTENING 1548
...


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here 1548 is the process ID, end the process with the command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

taskkill /PID 1548


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then start adb and there is no problem.&lt;/p&gt;

</description>
      <category>android</category>
      <category>adb</category>
    </item>
  </channel>
</rss>
