From baa26670baa59718f2e33b09e6ac74a447666355 Mon Sep 17 00:00:00 2001 From: Zhuang Ma Date: Thu, 1 Feb 2018 22:06:27 +0800 Subject: [PATCH] Refactor structure --- README.en.md | 45 ++++++++++++++++++++++-- README.md | 38 +++++++++----------- aapt.md => related/aapt.md | 0 am.md => related/am.md | 0 dumpsys.md => related/dumpsys.md | 0 pm.md => related/pm.md | 0 uiautomator.md => related/uiautomator.md | 0 7 files changed, 59 insertions(+), 24 deletions(-) rename aapt.md => related/aapt.md (100%) rename am.md => related/am.md (100%) rename dumpsys.md => related/dumpsys.md (100%) rename pm.md => related/pm.md (100%) rename uiautomator.md => related/uiautomator.md (100%) diff --git a/README.en.md b/README.en.md index 3cc704e..fe429b6 100644 --- a/README.en.md +++ b/README.en.md @@ -38,10 +38,12 @@ Other languages: [:cn: Chinese](./README.md) * [Query package detail information](#query-package-detail-information) * [Query application installation path](#query-application-installation-path) * [Interact with Applications](#interact-with-applications) - * [Start an Activity](#start-an-activity) + * [Launch app / Start an Activity](#launch-app--start-an-activity) * [Start a Service](#start-a-service) + * [Stop service](#stop-service) * [Send a broadcast](#send-a-broadcast) * [Force stop an application](#force-stop-an-application) + * [Trim memory](#trim-memory) * [File Management](#file-management) * [Copy files from a device to a computer](#copy-files-from-a-device-to-a-computer) * [Copy files from a computer to a device](#copy-files-from-a-computer-to-a-device) @@ -109,6 +111,7 @@ Other languages: [:cn: Chinese](./README.md) * [Start adb server failure](#start-adb-server-failure) * [com.android.ddmlib.AdbCommandRejectedException](#comandroidddmlibadbcommandrejectedexception) * [adb unofficial implementation](#adb-unofficial-implementation) +* [related commands](#related-commands) * [Acknowledgements](#acknowledgements) * [Reference Links](#reference-links) @@ -815,7 +818,7 @@ There are some options addting data for ``, similar to `extra` for Bundl | `--eia [, [, +``` + ### Send a broadcast The syntax is: @@ -922,6 +933,25 @@ adb shell am force-stop com.qihoo360.mobilesafe The command above means stopping all processes and services related to the package name `com.qihoo360.mobilesafe`. +### Trim memory + +command: + +```sh +adb shell am send-trim-memory +``` + +pid: process id +level: HIDDEN、RUNNING_MODERATE、BACKGROUND、RUNNING_LOW、MODERATE、RUNNING_CRITICAL、COMPLETE + +For example: + +```sh +adb shell am send-trim-memory 12345 RUNNING_LOW +``` + +means send command to process 12345, notify it to set level to RUNNING. + ## File Management ### Copy files from a device to a computer @@ -2382,11 +2412,20 @@ So just delete the emulator and re-download, reinstall, all is well now. * [fb-adb](https://github.com/facebook/fb-adb) - A better shell for Android devices (for Mac). +## related commands + +* [aapt](./related/aapt.md) +* [am](./related/am.md) +* [dumsys](./related/dumpsys.md) +* [pm](./related/pm.md) +* [uiautomator](./related/uiautomator.md) + ## Acknowledgements Thanks friends for theirs selfless sharing and supplement. Names listed in no particular order. -[zxning](https://github.com/zxning), [linhua55](https://github.com/linhua55), [codeskyblue](https://github.com/codeskyblue), [seasonyuu](https://github.com/seasonyuu), [fan123199](https://github.com/fan123199), [zhEdward](https://github.com/zhEdward), [0x8BADFOOD](https://github.com/0x8BADFOOD), [keith666666](https://github.com/keith666666), [shawnlinboy](https://github.com/shawnlinboy). +[zxning](https://github.com/zxning), [linhua55](https://github.com/linhua55), [codeskyblue](https://github.com/codeskyblue), [seasonyuu](https://github.com/seasonyuu), [fan123199](https://github.com/fan123199), [zhEdward](https://github.com/zhEdward), [0x8BADFOOD](https://github.com/0x8BADFOOD), [keith666666](https://github.com/keith666666), [shawnlinboy](https://github.com/shawnlinboy), [s-xq](https://github.com/s-xq), +[lucky9322](https://github.com/lucky9322). ## Reference Links diff --git a/README.md b/README.md index d856b36..b14deb0 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,11 @@ Other languages: [:gb: English](./README.en.md) * [查看应用详细信息](#查看应用详细信息) * [查看应用安装路径](#查看应用安装路径) * [与应用交互](#与应用交互) - * [调起 Activity](#调起-activity) + * [启动应用/ 调起 Activity](#启动应用-调起-activity) * [调起 Service](#调起-service) * [停止 Service](#停止-service) * [发送广播](#发送广播) * [强制停止应用](#强制停止应用) - * [启动应用](#启动应用) * [收紧内存](#收紧内存) * [文件管理](#文件管理) * [复制设备里的文件到电脑](#复制设备里的文件到电脑) @@ -112,6 +111,7 @@ Other languages: [:gb: English](./README.en.md) * [启动 adb server 失败](#启动-adb-server-失败) * [com.android.ddmlib.AdbCommandRejectedException](#comandroidddmlibadbcommandrejectedexception) * [adb 的非官方实现](#adb-的非官方实现) +* [相关命令](#相关命令) * [致谢](#致谢) * [参考链接](#参考链接) @@ -823,7 +823,7 @@ package:/data/app/ecarx.weather-1.apk | `--eia [, [, -``` - -命令示例: -```sh -adb shell am start -n com.baidu.searchbox/com.baidu.searchbox.SplashActivity -``` - -表示启动手机百度 - ### 收紧内存 命令: ```sh adb shell am send-trim-memory +``` -pid:进程ID +pid: 进程 ID level: HIDDEN、RUNNING_MODERATE、BACKGROUND、 RUNNING_LOW、MODERATE、RUNNING_CRITICAL、COMPLETE -``` 命令示例: + ```sh adb shell am send-trim-memory 12345 RUNNING_LOW ``` -表示向pid=12345的进程,发出level=RUNNING_LOW的收紧内存命令 +表示向 pid=12345 的进程,发出 level=RUNNING_LOW 的收紧内存命令。 ## 文件管理 @@ -2451,11 +2438,20 @@ Otherwise check for a confirmation dialog on your device. * [fb-adb](https://github.com/facebook/fb-adb) - A better shell for Android devices (for Mac). +## 相关命令 + +* [aapt](./related/aapt.md) +* [am](./related/am.md) +* [dumsys](./related/dumpsys.md) +* [pm](./related/pm.md) +* [uiautomator](./related/uiautomator.md) + ## 致谢 感谢朋友们无私的分享与补充(排名不分先后)。 -[zxning](https://github.com/zxning),[linhua55](https://github.com/linhua55),[codeskyblue](https://github.com/codeskyblue),[seasonyuu](https://github.com/seasonyuu),[fan123199](https://github.com/fan123199),[zhEdward](https://github.com/zhEdward),[0x8BADFOOD](https://github.com/0x8BADFOOD),[keith666666](https://github.com/keith666666),[shawnlinboy](https://github.com/shawnlinboy)。 +[zxning](https://github.com/zxning),[linhua55](https://github.com/linhua55),[codeskyblue](https://github.com/codeskyblue),[seasonyuu](https://github.com/seasonyuu),[fan123199](https://github.com/fan123199),[zhEdward](https://github.com/zhEdward),[0x8BADFOOD](https://github.com/0x8BADFOOD),[keith666666](https://github.com/keith666666),[shawnlinboy](https://github.com/shawnlinboy),[s-xq](https://github.com/s-xq), +[lucky9322](https://github.com/lucky9322)。 ## 参考链接 diff --git a/aapt.md b/related/aapt.md similarity index 100% rename from aapt.md rename to related/aapt.md diff --git a/am.md b/related/am.md similarity index 100% rename from am.md rename to related/am.md diff --git a/dumpsys.md b/related/dumpsys.md similarity index 100% rename from dumpsys.md rename to related/dumpsys.md diff --git a/pm.md b/related/pm.md similarity index 100% rename from pm.md rename to related/pm.md diff --git a/uiautomator.md b/related/uiautomator.md similarity index 100% rename from uiautomator.md rename to related/uiautomator.md