首页 > 系统相关 >adb shell命令整理之service

adb shell命令整理之service

时间:2022-10-18 17:38:51浏览次数:39  
标签:shell service app internal adb android com

service可给Android 服务传消息,具体用法如下:

Usage: service [-h|-?]
service list
service check SERVICE
service call SERVICE CODE [i32 INT | s16 STR] ...
Options:
i32: Write the integer INT into the send parcel.
s16: Write the UTF-16 string STR into the send parcel.

在Android 4.2.2模拟器上运行如下命令:

adb shell service list

Found 70 services:
0 sip: [android.net.sip.ISipService]
1 phone: [com.android.internal.telephony.ITelephony]
2 iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
3 simphonebook: [com.android.internal.telephony.IIccPhoneBook]
4 isms: [com.android.internal.telephony.ISms]
5 dreams: [android.service.dreams.IDreamManager]
6 commontime_management: []
7 samplingprofiler: []
8 diskstats: []
9 appwidget: [com.android.internal.appwidget.IAppWidgetService]
10 backup: [android.app.backup.IBackupManager]
11 uimode: [android.app.IUiModeManager]
12 serial: [android.hardware.ISerialManager]
13 usb: [android.hardware.usb.IUsbManager]
14 audio: [android.media.IAudioService]
15 wallpaper: [android.app.IWallpaperManager]
16 dropbox: [com.android.internal.os.IDropBoxManagerService]
17 search: [android.app.ISearchManager]
18 country_detector: [android.location.ICountryDetector]
19 location: [android.location.ILocationManager]
20 devicestoragemonitor: []
21 notification: [android.app.INotificationManager]
22 updatelock: [android.os.IUpdateLock]
23 throttle: [android.net.IThrottleManager]
24 servicediscovery: [android.net.nsd.INsdManager]
25 connectivity: [android.net.IConnectivityManager]
26 wifi: [android.net.wifi.IWifiManager]
27 wifip2p: [android.net.wifi.p2p.IWifiP2pManager]
28 netpolicy: [android.net.INetworkPolicyManager]
29 netstats: [android.net.INetworkStatsService]
30 textservices: [com.android.internal.textservice.ITextServicesManager]
31 network_management: [android.os.INetworkManagementService]
32 clipboard: [android.content.IClipboard]
33 statusbar: [com.android.internal.statusbar.IStatusBarService]
34 device_policy: [android.app.admin.IDevicePolicyManager]
35 lock_settings: [com.android.internal.widget.ILockSettings]
36 mount: [IMountService]
37 accessibility: [android.view.accessibility.IAccessibilityManager]
38 input_method: [com.android.internal.view.IInputMethodManager]
39 bluetooth_manager: [android.bluetooth.IBluetoothManager]
40 input: [android.hardware.input.IInputManager]
41 window: [android.view.IWindowManager]
42 alarm: [android.app.IAlarmManager]
43 vibrator: [android.os.IVibratorService]
44 battery: []
45 hardware: [android.os.IHardwareService]
46 content: [android.content.IContentService]
47 account: [android.accounts.IAccountManager]
48 user: [android.os.IUserManager]
49 permission: [android.os.IPermissionController]
50 cpuinfo: []
51 dbinfo: []
52 gfxinfo: []
53 meminfo: []
54 activity: [android.app.IActivityManager]
55 package: [android.content.pm.IPackageManager]
56 media.audio_policy: [android.media.IAudioPolicyService]
57 scheduling_policy: [android.os.ISchedulingPolicyService]
58 telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]
59 display: [android.hardware.display.IDisplayManager]
60 usagestats: [com.android.internal.app.IUsageStats]
61 batteryinfo: [com.android.internal.app.IBatteryStats]
62 power: [android.os.IPowerManager]
63 entropy: []
64 sensorservice: [android.gui.SensorServer]
65 media.camera: [android.hardware.ICameraService]
66 media.player: [android.media.IMediaPlayerService]
67 media.audio_flinger: [android.media.IAudioFlinger]
68 SurfaceFlinger: [android.ui.ISurfaceComposer]
69 drm.drmManager: [drm.IDrmManagerService] envsetup.sh中揭示了几条未揭露的adb shell命令:

1.绑定port启动ViewServer
adb shell service call window 1 i32 $port

2.停止ViewServer
adb shell service call window 2

3.检查ViewServer是否正在运行
adb shell service call window 3

4.按home键(详见KeyEvent.java中的定义)
adb shell input keyevent 3

5.按back键
adb shell input keyevent 4

6.按menu键
adb shell input keyevent 82

7.ViewRootImpl.java
设置系统属性“viewancestor.profile_rendering”为true能强制当前窗口以60 HZ渲染。它可用作度量潜在帧率。

8.显示fps
dumpsys gfxinfo activity_name adb shell service call SurfaceFlinger 1013 来源见SurfaceFlinger.cpp中函数onTransact的switch片段,使用见surface_stats_collector.py

标签:shell,service,app,internal,adb,android,com
From: https://blog.51cto.com/u_13733787/5767838

相关文章

  • shell编程基础
    一、为什么要实现shell编程shell集合了大量命令,借助shell,大量任务可以实现自动化,提高效率。 二、脚本1、代码:#!/bin/sh符号#!用来告诉系统执行该脚本的程序。编辑完,如果要执......
  • Shell实用脚本编写思路
    归档备份步骤创建归档目录配置文件(源)读出归档配置文件的目录名(exec+read)判断配置文件中目录是否存在(-d)判断目录名里面的文件是否存在(-f)创建归档存放的目录......
  • Jmeter添加BeanShell后置处理程序保存响应结果
    对于某些请求,无法通过保存响应到文件这个组件来进行保存(会出现UNKNOW文件类型)。那么就可以通过BeanShell后置处理程序来进行将响应结果直接输出到文件,并可以直接指定文件......
  • ShellProgressBar控制台中漂亮的显示进度条
    ShellProgressBar控制台中漂亮的显示进度条ShellProgressBar库的使用控制台程序有时也需要进度条来显示任务执行的详细进度,最近就发现了一个第三方的类库叫ShellProgress......
  • 45、shell编程-函数
    函数function是由多个shell组成的语言块,实现代码重用和模块化编程,与shell类型,不同点为shell程序运行会单独开启进程,而函数不会开启进程,是在当前shell环境中运行,可影响当前sh......
  • shell的流程控制语句
    shell的流程控制语句:选择判断循环shell的条件选择语句:ifif分为单分支、双分支和多分支单分支格式:if判断条件;then执行的操作fi例如:[root@CentOS7~......
  • shell的条件测试语句:test
    条件测试:  判断某需求是否满足,需要由测试机制来实现,专用的测试表达式需要由测试命令辅助完成测试结果:若真,则状态码变量$?返回0若假,则状态码变量$?返回1条......
  • 已整理-shell脚本编程资料整理
    目录:1、变量的定义与类型2、配置用户环境3、shell的整数运算4、条件测试5、if条件分支6、循环7、ca......
  • mac上的类xshell的工具termius功能研究测试,附mac上安装brew并解压asar文件
    1.安装brew1.1nodejsbrew的安装目录在/usr/local/Cellar,我们以安装nodejs为例子,只需要执行:brewinstallnodejs1.2brew使用中科大源安装brew /usr/bin/ruby-e"$(......
  • Shell图形化脚本基础
    脚本菜单创建菜单创建菜单函数functionmemu{clearechoecho-e"\t\tTHEFUNCTION\n"echo-e"\t1.FUNCTION1"......