ADB command system pre-installed application to uninstall

https://developer.android.com/studio/command-line/adb

Applications preinstalled divided into three kinds:

Can not uninstall
this part do not have root privileges, it can not be uninstalled. Such as Phone, Message, Calendar and so on.
Uninstall, restore
this part without root privileges, users can also uninstall, but will come back later to restore the factory. For example, APP EMUI preset number of third parties.
Uninstall, do not restore
this part of the preset in the data partition, data partition is a partition to store user data, will clean out this part of the APP restore the factory when empty data. This situation is typical for special purposes, such as factory before testing the quality of the hardware portion of the tool APP, restore factory test finished, the user will not feel.
Generally speaking, the application refers to uninstall the pre-first kind, but said above, do not have root privileges can not be uninstalled, in fact, the method described in this article to deal with the second case similar to the above, although you can uninstall the free root Preferences application, but not completely remove APK, it can not be restored (after deleting the root is usually completely removed).

First mobile terminal to activate developer mode, then connect the cable to the computer type-c end, cmd shell enter debug mode,
there are two ways to find the name of the application you want to delete

  1. Use pm list packages | grep "app"command to find;
  2. First open the APP, and then dumpsys window | grep mCurrentFocusview the current interface information;

And then uninstall:

pm uninstall -k --user 0 packageName

Wherein the stored data represents -k, -k need not be removed. --user Specifies the user id, Android system supports multiple users, only a default user, id = 0.


Android Debug Bridge (adb) is a versatile command-line tool that allows you to communicate with the device. adb facilitate the execution of the command operations of various devices (e.g., installation and commissioning application), and provides access to the Unix shell (on the device can be used to run various command). It is a client - server program, comprising the following three components:

Client: for sending commands. The client runs on the development machine. You can command from the command line by issuing an adb client terminal calls.
Daemon (adbd): Run command on the device. Daemon running on each device as a background process.
Server: manages the communication between the client and the daemon. Server runs as a background process on the development computer.
adb included in the Android SDK platform tools package. You can use the SDK Manager to download this package, the package manager will install this in android_sdk/platform-tools/. Or, if you need a separate Android SDK platform tools package, you can click here to download.

Windows ADB Installation:
https://dl.google.com/android/repository/platform-tools-latest-windows.zip

Works of adb
When you start an adb client, the client will first check whether there adb server process is running. If not, it starts the server process. 5037 will bind the server starts with local TCP port and listens adb command sent by the client - the client are all adb adb server communication port 5037 and through.

The server then establishes a connection with all the equipment running. By scanning the odd-numbered port that between 5555 to 5585 (the first 16 for the range used by the simulator) lookup simulator. Once adb server daemon (adbd), will establish a connection with the corresponding port. Note that each simulator uses a pair of ports in sequence - the console port for connecting the even-numbered and odd-numbered port for adb connections. E.g:

Simulator 1, the console: 5554
simulator 1, adb: 5555
Simulator 2, the console: 5556
simulator 2, adb: 5557
and so on ...

As described above, port 5555 is connected to the simulator console adb listening port 5554 is the same simulator.

After the server and all devices to establish a connection, you can access these devices will use adb command. Since the connection to the server management devices and handle multiple adb commands from the client, so you can (or from a script) to control any device from any client.

Guess you like

Origin blog.51cto.com/1960961732/2445248