255|yfve_8q:/ # pm
Package manager (package) commands:
help
Print this help text.
path [--user USER_ID] PACKAGE
Print the path to the .apk of the given PACKAGE.
dump PACKAGE
Print various system state associated with the given PACKAGE.
list features
Prints all features of the system.
has-feature FEATURE_NAME [version]
Prints true and returns exit status 0 when system has a FEATURE_NAME,
otherwise prints false and returns exit status 1
list instrumentation [-f] [TARGET-PACKAGE]
Prints all test packages; optionally only those targeting TARGET-PACKAGE
Options:
-f: dump the name of the .apk file containing the test package
list libraries
Prints all system libraries.
list packages [-f] [-d] [-e] [-s] [-3] [-i] [-l] [-u] [-U]
[--uid UID] [--user USER_ID] [FILTER]
Prints all packages; optionally only those whose name contains
the text in FILTER. Options are:
-f: see their associated file
-d: filter to only show disabled packages
-e: filter to only show enabled packages
-s: filter to only show system packages
-3: filter to only show third party packages
-i: see the installer for the packages
-l: ignored (used for compatibility with older releases)
-U: also show the package UID
-u: also include uninstalled packages
--uid UID: filter to only show packages with the given UID
--user USER_ID: only list packages belonging to the given user
list permission-groups
Prints all known permission groups.
list permissions [-g] [-f] [-d] [-u] [GROUP]
Prints all known permissions; optionally only those in GROUP. Options are:
-g: organize by group
-f: print all information
-s: short summary
-d: only list dangerous permissions
-u: list only the permissions users will see
resolve-activity [--brief] [--components] [--user USER_ID] INTENT
Prints the activity that resolves to the given INTENT.
query-activities [--brief] [--components] [--user USER_ID] INTENT
Prints all activities that can handle the given INTENT.
query-services [--brief] [--components] [--user USER_ID] INTENT
Prints all services that can handle the given INTENT.
query-receivers [--brief] [--components] [--user USER_ID] INTENT
Prints all broadcast receivers that can handle the given INTENT.
install [-lrtsfdg] [-i PACKAGE] [--user USER_ID|all|current]
[-p INHERIT_PACKAGE] [--install-location 0/1/2]
[--originating-uri URI] [---referrer URI]
[--abi ABI_NAME] [--force-sdk]
[--preload] [--instantapp] [--full] [--dont-kill]
[--force-uuid internal|UUID] [--pkg PACKAGE] [-S BYTES] [PATH|-]
Install an application. Must provide the apk data to install, either as a
file path or '-' to read from stdin. Options are:
-l: forward lock application
-R: disallow replacement of existing application
-t: allow test packages
-i: specify package name of installer owning the app
-s: install application on sdcard
-f: install application on internal flash
-d: allow version code downgrade (debuggable packages only)
-p: partial application install (new split on top of existing pkg)
-g: grant all runtime permissions
-S: size in bytes of package, required for stdin
--user: install under the given user.
--dont-kill: installing a new feature split, don't kill running app
--originating-uri: set URI where app was downloaded from
--referrer: set URI that instigated the install of the app
--pkg: specify expected package name of app being installed
--abi: override the default ABI of the platform
--instantapp: cause the app to be installed as an ephemeral install app
--full: cause the app to be installed as a non-ephemeral full app
--install-location: force the install location:
0=auto, 1=internal only, 2=prefer external
--force-uuid: force install on to disk volume with given UUID
--force-sdk: allow install even when existing app targets platform
codename but new one targets a final API level
install-create [-lrtsfdg] [-i PACKAGE] [--user USER_ID|all|current]
[-p INHERIT_PACKAGE] [--install-location 0/1/2]
[--originating-uri URI] [---referrer URI]
[--abi ABI_NAME] [--force-sdk]
[--preload] [--instantapp] [--full] [--dont-kill]
[--force-uuid internal|UUID] [--pkg PACKAGE] [-S BYTES]
Like "install", but starts an install session. Use "install-write"
to push data into the session, and "install-commit" to finish.
install-write [-S BYTES] SESSION_ID SPLIT_NAME [PATH|-]
Write an apk into the given install session. If the path is '-', data
will be read from stdin. Options are:
-S: size in bytes of package, required for stdin
install-commit SESSION_ID
Commit the given active install session, installing the app.
install-abandon SESSION_ID
Delete the given active install session.
set-install-location LOCATION
Changes the default install location. NOTE this is only intended for debugging;
using this can cause applications to break and other undersireable behavior.
LOCATION is one of:
0 [auto]: Let system decide the best location
1 [internal]: Install on internal device storage
2 [external]: Install on external media
get-install-location
Returns the current install location: 0, 1 or 2 as per set-install-location.
move-package PACKAGE [internal|UUID]
move-primary-storage [internal|UUID]
pm uninstall [-k] [--user USER_ID] [--versionCode VERSION_CODE] PACKAGE [SPLIT]
Remove the given package name from the system. May remove an entire app
if no SPLIT name is specified, otherwise will remove only the split of the
given app. Options are:
-k: keep the data and cache directories around after package removal.
--user: remove the app from the given user.
--versionCode: only uninstall if the app has the given version code.
clear [--user USER_ID] PACKAGE
Deletes all data associated with a package.
enable [--user USER_ID] PACKAGE_OR_COMPONENT
disable [--user USER_ID] PACKAGE_OR_COMPONENT
disable-user [--user USER_ID] PACKAGE_OR_COMPONENT
disable-until-used [--user USER_ID] PACKAGE_OR_COMPONENT
default-state [--user USER_ID] PACKAGE_OR_COMPONENT
These commands change the enabled state of a given package or
component (written as "package/class").
hide [--user USER_ID] PACKAGE_OR_COMPONENT
unhide [--user USER_ID] PACKAGE_OR_COMPONENT
suspend [--user USER_ID] TARGET-PACKAGE
Suspends the specified package (as user).
unsuspend [--user USER_ID] TARGET-PACKAGE
Unsuspends the specified package (as user).
grant [--user USER_ID] PACKAGE PERMISSION
revoke [--user USER_ID] PACKAGE PERMISSION
These commands either grant or revoke permissions to apps. The permissions
must be declared as used in the app's manifest, be runtime permissions
(protection level dangerous), and the app targeting SDK greater than Lollipop MR1.
reset-permissions
Revert all runtime permissions to their default state.
set-permission-enforced PERMISSION [true|false]
get-privapp-permissions TARGET-PACKAGE
Prints all privileged permissions for a package.
get-privapp-deny-permissions TARGET-PACKAGE
Prints all privileged permissions that are denied for a package.
get-oem-permissions TARGET-PACKAGE
Prints all OEM permissions for a package.
set-app-link [--user USER_ID] PACKAGE {always|ask|never|undefined}
get-app-link [--user USER_ID] PACKAGE
trim-caches DESIRED_FREE_SPACE [internal|UUID]
Trim cache files to reach the given free space.
create-user [--profileOf USER_ID] [--managed] [--restricted] [--ephemeral]
[--guest] USER_NAME
Create a new user with the given USER_NAME, printing the new user identifier
of the user.
remove-user USER_ID
Remove the user with the given USER_IDENTIFIER, deleting all data
associated with that user
set-user-restriction [--user USER_ID] RESTRICTION VALUE
get-max-users
get-max-running-users
compile [-m MODE | -r REASON] [-f] [-c] [--split SPLIT_NAME]
[--reset] [--check-prof (true | false)] (-a | TARGET-PACKAGE)
Trigger compilation of TARGET-PACKAGE or all packages if "-a". Options are:
-a: compile all packages
-c: clear profile data before compiling
-f: force compilation even if not needed
-m: select compilation mode
MODE is one of the dex2oat compiler filters:
assume-verified
extract
verify
quicken
space-profile
space
speed-profile
speed
everything
-r: select compilation reason
REASON is one of:
first-boot
boot
install
bg-dexopt
ab-ota
inactive
shared
--reset: restore package to its post-install state
--check-prof (true | false): look at profiles when doing dexopt?
--secondary-dex: compile app secondary dex files
--split SPLIT: compile only the given split name
force-dex-opt PACKAGE
Force immediate execution of dex opt for the given PACKAGE.
bg-dexopt-job
Execute the background optimizations immediately.
Note that the command only runs the background optimizer logic. It may
overlap with the actual job but the job scheduler will not be able to
cancel it. It will also run even if the device is not in the idle
maintenance mode.
reconcile-secondary-dex-files TARGET-PACKAGE
Reconciles the package secondary dex files with the generated oat files.
dump-profiles TARGET-PACKAGE
Dumps method/class profile files to
/data/misc/profman/TARGET-PACKAGE.txt
snapshot-profile TARGET-PACKAGE [--code-path path]
Take a snapshot of the package profiles to
/data/misc/profman/TARGET-PACKAGE[-code-path].prof
If TARGET-PACKAGE=android it will take a snapshot of the boot image
set-home-activity [--user USER_ID] TARGET-COMPONENT
Set the default home activity (aka launcher).
set-installer PACKAGE INSTALLER
Set installer package name
get-instantapp-resolver
Return the name of the component that is the current instant app installer.
set-harmful-app-warning [--user ] []
Mark the app as harmful with the given warning message.
get-harmful-app-warning [--user ]
Return the harmful app warning message for the given app, if present
uninstall-system-updates
Remove updates to all system applications and fall back to their /system version.
specifications include these flags and arguments:
[-a ] [-d ] [-t ]
[-c [-c ] ...]
[-n ]
[-e|--es ...]
[--esn ...]
[--ez ...]
[--ei ...]
[--el ...]
[--ef ...]
[--eu ...]
[--ecn ]
[--eia [,[,)
[--ela [,[,)
[--efa [,[,)
[--esa [,[,; to embed a comma into a string,
escape it using "\,")
[-f ]
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--grant-persistable-uri-permission] [--grant-prefix-uri-permission]
[--debug-log-resolution] [--exclude-stopped-packages]
[--include-stopped-packages]
[--activity-brought-to-front] [--activity-clear-top]
[--activity-clear-when-task-reset] [--activity-exclude-from-recents]
[--activity-launched-from-history] [--activity-multiple-task]
[--activity-no-animation] [--activity-no-history]
[--activity-no-user-action] [--activity-previous-is-top]
[--activity-reorder-to-front] [--activity-reset-task-if-needed]
[--activity-single-top] [--activity-clear-task]
[--activity-task-on-home] [--activity-match-external]
[--receiver-registered-only] [--receiver-replace-pending]
[--receiver-foreground] [--receiver-no-abort]
[--receiver-include-background]
[--selector]
[ | | ]
yfve_8q:/ #
pm意思是PackageManager,可以获取到Android系统中的应用信息。 pm list package:获取所有安装在设备上的应用包名。
yfve_8q:/ # am -h
Activity manager (activity) commands:
help
Print this help text.
start-activity [-D] [-N] [-W] [-P ] [--start-profiler ]
[--sampling INTERVAL] [--streaming] [-R COUNT] [-S]
[--track-allocation] [--user | current]
Start an Activity. Options are:
-D: enable debugging
-N: enable native debugging
-W: wait for launch to complete
--start-profiler : start profiler and send results to
--sampling INTERVAL: use sample profiling with INTERVAL microseconds
between samples (use with --start-profiler)
--streaming: stream the profiling output to the specified file
(use with --start-profiler)
-P : like above, but profiling stops when app goes idle
--attach-agent : attach the given agent before binding
--attach-agent-bind : attach the given agent during binding
-R: repeat the activity launch times. Prior to each repeat,
the top activity will be finished.
-S: force stop the target app before starting the activity
--track-allocation: enable tracking of object allocations
--user | current: Specify which user to run as; if not
specified then run as the current user.
--windowingMode : The windowing mode to launch the activity into.
--activityType : The activity type to launch the activity as.
start-service [--user | current]
Start a Service. Options are:
--user | current: Specify which user to run as; if not
specified then run as the current user.
start-foreground-service [--user | current]
Start a foreground Service. Options are:
--user | current: Specify which user to run as; if not
specified then run as the current user.
stop-service [--user | current]
Stop a Service. Options are:
--user | current: Specify which user to run as; if not
specified then run as the current user.
broadcast [--user | all | current]
Send a broadcast Intent. Options are:
--user | all | current: Specify which user to send to; if not
specified then send to all users.
--receiver-permission : Require receiver to hold permission.
instrument [-r] [-e ] [-p ] [-w]
[--user | current] [--no-hidden-api-checks]
[--no-window-animation] [--abi ]
Start an Instrumentation. Typically this target is in the
form / or only if there
is only one instrumentation. Options are:
-r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). Use with
[-e perf true] to generate raw output for performance measurements.
-e : set argument to . For test runners a
common form is [-e [,...]].
-p : write profiling data to
-m: Write output as protobuf to stdout (machine readable)
-f : Write output as protobuf to a file (machine
readable). If path is not specified, default directory and file name will
be used: /sdcard/instrument-logs/log-yyyyMMdd-hhmmss-SSS.instrumentation_data_proto
-w: wait for instrumentation to finish before returning. Required for
test runners.
--user | current: Specify user instrumentation runs in;
current user if not specified.
--no-hidden-api-checks: disable restrictions on use of hidden API.
--no-window-animation: turn off window animations while running.
--abi : Launch the instrumented process with the selected ABI.
This assumes that the process supports the selected ABI.
trace-ipc [start|stop] [--dump-file ]
Trace IPC transactions.
start: start tracing IPC transactions.
stop: stop tracing IPC transactions and dump the results to file.
--dump-file : Specify the file the trace should be dumped to.
profile [start|stop] [--user current] [--sampling INTERVAL]
[--streaming]
Start and stop profiler on a process. The given argument
may be either a process name or pid. Options are:
--user | current: When supplying a process name,
specify user of process to profile; uses current user if not specified.
--sampling INTERVAL: use sample profiling with INTERVAL microseconds
between samples
--streaming: stream the profiling output to the specified file
dumpheap [--user current] [-n] [-g]
Dump the heap of a process. The given argument may
be either a process name or pid. Options are:
-n: dump native heap instead of managed heap
-g: force GC before dumping the heap
--user | current: When supplying a process name,
specify user of process to dump; uses current user if not specified.
set-debug-app [-w] [--persistent]
Set application to debug. Options are:
-w: wait for debugger when application starts
--persistent: retain this value
clear-debug-app
Clear the previously set-debug-app.
set-watch-heap
Start monitoring pss size of , if it is at or
above then a heap dump is collected for the user to report.
clear-watch-heap
Clear the previously set-watch-heap.
bug-report [--progress | --telephony]
Request bug report generation; will launch a notification
when done to select where it should be delivered. Options are:
--progress: will launch a notification right away to show its progress.
--telephony: will dump only telephony sections.
force-stop [--user | all | current]
Completely stop the given application package.
crash [--user ]
Induce a VM crash in the specified package or process
kill [--user | all | current]
Kill all background processes associated with the given application.
kill-all
Kill all processes that are safe to kill (cached, etc).
make-uid-idle [--user | all | current]
If the given application's uid is in the background and waiting to
become idle (not allowing background services), do that now.
monitor [--gdb ]
Start monitoring for crashes or ANRs.
--gdb: start gdbserv on the given port at crash/ANR
watch-uids [--oom ]
Start watching for and reporting uid state changes.
--oom: specify a uid for which to report detailed change messages.
hang [--allow-restart]
Hang the system.
--allow-restart: allow watchdog to perform normal system restart
restart
Restart the user-space system.
idle-maintenance
Perform idle maintenance now.
screen-compat [on|off]
Control screen compatibility mode of .
package-importance
Print current importance of .
to-uri [INTENT]
Print the given Intent specification as a URI.
to-intent-uri [INTENT]
Print the given Intent specification as an intent: URI.
to-app-uri [INTENT]
Print the given Intent specification as an android-app: URI.
switch-user
Switch to put USER_ID in the foreground, starting
execution of that user if it is currently stopped.
get-current-user
Returns id of the current foreground user.
start-user
Start USER_ID in background if it is currently stopped;
use switch-user if you want to start the user in foreground
unlock-user [TOKEN_HEX]
Attempt to unlock the given user using the given authorization token.
stop-user [-w] [-f]
Stop execution of USER_ID, not allowing it to run any
code until a later explicit start or switch to it.
-w: wait for stop-user to complete.
-f: force stop even if there are related users that cannot be stopped.
is-user-stopped
Returns whether has been stopped or not.
get-started-user-state
Gets the current state of the given started user.
track-associations
Enable association tracking.
untrack-associations
Disable and clear association tracking.
get-uid-state
Gets the process state of an app given its .
attach-agent
Attach an agent to the specified , which may be either a process name or a PID.
get-config [--days N] [--device] [--proto]
Retrieve the configuration and any recent configurations of the device.
--days: also return last N days of configurations that have been seen.
--device: also output global device configuration info.
--proto: return result as a proto; does not include --days info.
supports-multiwindow
Returns true if the device supports multiwindow.
supports-split-screen-multi-window
Returns true if the device supports split screen multiwindow.
suppress-resize-config-changes
Suppresses configuration changes due to user resizing an activity/task.
set-inactive [--user ] true|false
Sets the inactive state of an app.
get-inactive [--user ]
Returns the inactive state of an app.
set-standby-bucket [--user ] active|working_set|frequent|rare
Puts an app in the standby bucket.
get-standby-bucket [--user ]
Returns the standby bucket of an app.
send-trim-memory [--user ]
[HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE|RUNNING_CRITICAL|COMPLETE]
Send a memory trim event to a . May also supply a raw trim int level.
display [COMMAND] [...]: sub-commands for operating on displays.
move-stack
Move from its current display to .
stack [COMMAND] [...]: sub-commands for operating on activity stacks.
start
Start a new activity on using
move-task [true|false]
Move from its current stack to the top (true) or
bottom (false) of .
resize
Change size and position to .
resize-animated
Same as resize, but allow animation.
resize-docked-stack []
Change docked stack to
and supplying temporary different task bounds indicated by
move-top-activity-to-pinned-stack:
Moves the top activity from
to the pinned stack using for the
bounds of the pinned stack.
positiontask
Place in at
list
List all of the activity stacks and their sizes.
info
Display the information about activity stack in and .
remove
Remove stack .
task [COMMAND] [...]: sub-commands for operating on activity tasks.
lock
Bring to the front and don't allow other tasks to run.
lock stop
End the current task lock.
resizeable [0|1|2|3]
Change resizeable mode of to one of the following:
0: unresizeable
1: crop_windows
2: resizeable
3: resizeable_and_pipable
resize
Makes sure is in a stack with the specified bounds.
Forces the task to be resizeable and creates a stack if no existing stack
has the specified bounds.
update-appinfo [...]
Update the ApplicationInfo objects of the listed packages for
without restarting any processes.
write
Write all pending state to storage.
specifications include these flags and arguments:
[-a ] [-d ] [-t ]
[-c [-c ] ...]
[-n ]
[-e|--es ...]
[--esn ...]
[--ez ...]
[--ei ...]
[--el ...]
[--ef ...]
[--eu ...]
[--ecn ]
[--eia [,[,)
[--ela [,[,)
[--efa [,[,)
[--esa [,[,; to embed a comma into a string,
escape it using "\,")
[-f ]
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--grant-persistable-uri-permission] [--grant-prefix-uri-permission]
[--debug-log-resolution] [--exclude-stopped-packages]
[--include-stopped-packages]
[--activity-brought-to-front] [--activity-clear-top]
[--activity-clear-when-task-reset] [--activity-exclude-from-recents]
[--activity-launched-from-history] [--activity-multiple-task]
[--activity-no-animation] [--activity-no-history]
[--activity-no-user-action] [--activity-previous-is-top]
[--activity-reorder-to-front] [--activity-reset-task-if-needed]
[--activity-single-top] [--activity-clear-task]
[--activity-task-on-home] [--activity-match-external]
[--receiver-registered-only] [--receiver-replace-pending]
[--receiver-foreground] [--receiver-no-abort]
[--receiver-include-background]
[--selector]
[ | | ]
yfve_8q:/ #
am start:启动一个Activity。 例如: 启动相机: am start -n com.android.camera/.Camera 先停止目标应用,再启动: am start -S com.android.camera/.Camera 等待应用完成启动: am start -W com.android.camera/.Camera 启动默认浏览器打开一个网页: am start -a android.intent.action.VIEW -d http://www.baidu.com 启动拨号器拨打 10086: am start -a android.intent.action.CALL -d tel:10086
am instrument , 启动一个 instrumentation , 单元测试或者 Robotium 会用到。
am monitor , 监控 crash 与 ANR。
am force-stop , 后跟包名,结束应用。
am startservice , 启动一个服务。
am broadcast , 发送一个广播。 后面的参数有: [-a ] [-d ] [-t ] [-c [-c ] …] [-e|–es …] [–ez …] [-e|–ei …] [-n ] [-f ] [] 例如: adb shell am broadcast -a com.android.test --es test_string “this is test string” --ei test_int 100 --ez test_boolean true
input
yfve_8q:/ # input
Usage: input [] [...]
The sources are:
dpad
keyboard
mouse
touchpad
gamepad
touchnavigation
joystick
touchscreen
stylus
trackball
The commands and default sources are:
text (Default: touchscreen)
keyevent [--longpress] ... (Default: keyboard)
tap (Default: touchscreen)
swipe [duration(ms)] (Default: touchscreen)
draganddrop [duration(ms)] (Default: touchscreen)
press (Default: trackball)
roll (Default: trackball)
yfve_8q:/ #
这个命令可以向 Android 设备发送按键事件,其源码 Input.java
input text , 发送文本内容,不能发送中文: input text test123456 前提先将键盘设置为英文键盘
input keyevent , 发送按键事件,KeyEvent.java: input keyevent KEYCODE_HOME 模拟按下 Home 键
input tap , 对屏幕发送一个触摸事件: input tap 500 500 点击屏幕上坐标为 500 500 的位置
yfve_8q:/ # screencap -h
usage: screencap [-hp] [-d display-id] [FILENAME]
-h: this message
-p: save the file as a png.
-d: specify the display id to capture, default 0.
If FILENAME ends with .png it will be saved as a png.
If FILENAME is not given, the results will be printed to stdout.
yfve_8q:/ #
yfve_8q:/ # screenrecord --h
Usage: screenrecord [options]
Android screenrecord v1.2. Records the device's display to a .mp4 file.
Options:
--size WIDTHxHEIGHT
Set the video size, e.g. "1280x720". Default is the device's main
display resolution (if supported), 1280x720 if not. For best results,
use a size supported by the AVC encoder.
--bit-rate RATE
Set the video bit rate, in bits per second. Value may be specified as
bits or megabits, e.g. '4000000' is equivalent to '4M'. Default 20Mbps.
--bugreport
Add additional information, such as a timestamp overlay, that is helpful
in videos captured to illustrate bugs.
--time-limit TIME
Set the maximum recording time, in seconds. Default / maximum is 180.
--verbose
Display interesting information on stdout.
--help
Show this message.
Recording continues until Ctrl-C is hit or the time limit is reached.
yfve_8q:/ #
# 执行命令后操作手机,ctrl + c 结束录制,录制结果保存至 sdcard
screenrecord /sdcard/record.mp4
uiautomator
执行 UI automation tests , 获取当前界面的控件信息
yfve_8q:/ # uiautomator -h
Usage: uiautomator [options]
Available subcommands:
help: displays help message
runtest: executes UI automation tests
runtest [options]
: < -c | -e class >
: a list of jar files containing test classes and dependencies. If
the path is relative, it's assumed to be under /data/local/tmp. Use
absolute path if the file is elsewhere. Multiple files can be
specified, separated by space.
: a list of test class names to run, separated by comma. To
a single method, use TestClass#testMethod format. The -e or -c option
may be repeated. This option is not required and if not provided then
all the tests in provided jars will be run automatically.
options:
--nohup: trap SIG_HUP, so test won't terminate even if parent process
is terminated, e.g. USB is disconnected.
-e debug [true|false]: wait for debugger to connect before starting.
-e runner [CLASS]: use specified test runner class instead. If
unspecified, framework default runner will be used.
-e : other name-value pairs to be passed to test classes.
May be repeated.
-e outputFormat simple | -s: enabled less verbose JUnit style output.
dump: creates an XML dump of current UI hierarchy
dump [--verbose][file]
[--compressed]: dumps compressed layout information.
[file]: the location where the dumped XML should be stored, default is
/sdcard/window_dump.xml
events: prints out accessibility events until terminated
yfve_8q:/ #
yfve_8q:/ # ime -h
ime :
list [-a] [-s]
prints all enabled input methods.
-a: see all input methods
-s: only a single summary line of each
enable
allows the given input method ID to be used.
disable
disallows the given input method ID to be used.
set
switches to the given input method ID.
reset
reset currently selected/enabled IMEs to the default ones as if the device is initially booted w
ith the current locale.
yfve_8q:/ #
ime list -s com.google.android.inputmethod.pinyin/.PinyinIME com.baidu.input_mi/.ImeService 列出设备上的输入法
adb shell ime set com.baidu.input_mi/.ImeService Input method com.baidu.input_mi/.ImeService selected 选择输入法
wm
WindowManager.java
yfve_8q:/ # wm -h
Window manager (window) commands:
help
Print this help text.
size [reset|WxH|WdpxHdp]
Return or override display size.
width and height in pixels unless suffixed with 'dp'.
density [reset|DENSITY]
Return or override display density.
overscan [reset|LEFT,TOP,RIGHT,BOTTOM]
Set overscan area for display.
scaling [off|auto]
Set display scaling mode.
dismiss-keyguard
Dismiss the keyguard, prompting user for auth if necessary.
yfve_8q:/ #
yfve_8q:/ # settings
Settings provider (settings) commands:
help
Print this help text.
get [--user | current] NAMESPACE KEY
Retrieve the current value of KEY.
put [--user | current] NAMESPACE KEY VALUE [TAG] [default]
Change the contents of KEY to VALUE.
TAG to associate with the setting.
{default} to set as the default, case-insensitive only for global/secure namespace
delete NAMESPACE KEY
Delete the entry for KEY.
reset [--user | current] NAMESPACE {PACKAGE_NAME | RESET_MODE}
Reset the global/secure table for a package with mode.
RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitive
list NAMESPACE
Print all defined keys.
NAMESPACE is one of {system, secure, global}, case-insensitive
yfve_8q:/ #
dumpsys
yfve_8q:/ # dumpsys --help
usage: dumpsys
To dump all services.
or:
dumpsys [-t TIMEOUT] [--priority LEVEL] [--help | -l | --skip SERVICES | SERVICE [ARGS]]
--help: shows this help
-l: only list services, do not dump them
-t TIMEOUT_SEC: TIMEOUT to use in seconds instead of default 10 seconds
-T TIMEOUT_MS: TIMEOUT to use in milliseconds instead of default 10 seconds
--proto: filter services that support dumping data in proto format. Dumps will be in proto format.
--priority LEVEL: filter services based on specified priority
LEVEL must be one of CRITICAL | HIGH | NORMAL
--skip SERVICES: dumps all services but SERVICES (comma-separated list)
SERVICE [ARGS]: dumps only service SERVICE, optionally passing ARGS to it
yfve_8q:/ #
yfve_8q:/ # logcat -h
Usage: logcat [options] [filterspecs]
options include:
-s Set default filter to silent. Equivalent to filterspec '*:S'
-f , --file= Log to file. Default is stdout
-r , --rotate-kbytes=
Rotate log every kbytes. Requires -f option
-n , --rotate-count=
Sets max number of rotated logs to , default 4
--id= If the signature id for logging to file changes, then clear
the fileset and continue
-v , --format=
Sets log print format verb and adverbs, where is:
brief help long process raw tag thread threadtime time
and individually flagged modifying adverbs can be added:
color descriptive epoch monotonic printable uid
usec UTC year zone
Multiple -v parameters or comma separated list of format and
format modifiers are allowed.
-D, --dividers Print dividers between each log buffer
-c, --clear Clear (flush) the entire log and exit
if Log to File specified, clear fileset instead
-d Dump the log and then exit (don't block)
-e , --regex=
Only print lines where the log message matches
where is a Perl-compatible regular expression
-m , --max-count=
Quit after printing lines. This is meant to be
paired with --regex, but will work on its own.
--print Paired with --regex and --max-count to let content bypass
regex filter but still stop at number of matches.
-t Print only the most recent lines (implies -d)
-t '
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000777c3290, pid=5632, tid=6656
#
# JRE version: Java(TM) SE Ru
Spring 中提供一些Aware相关de接口,BeanFactoryAware、 ApplicationContextAware、ResourceLoaderAware、ServletContextAware等等,其中最常用到de匙ApplicationContextAware.实现ApplicationContextAwaredeBean,在Bean被初始后,将会被注入 Applicati
在Java项目中,我们通常会自己写一个DateUtil类,处理日期和字符串的转换,如下所示:
public class DateUtil01 {
private SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public void format(Date d
问题描述:
在实现类中的某一或某几个Override方法发生编译错误如下:
Name clash: The method put(String) of type XXXServiceImpl has the same erasure as put(String) of type XXXService but does not override it
当去掉@Over