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 68 services:

0    phone: [com.android.internal.telephony.ITelephony]

1    iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]

2    simphonebook: [com.android.internal.telephony.IIccPhoneBook]

3    isms: [com.android.internal.telephony.ISms]

4    dreams: [android.service.dreams.IDreamManager]

5    commontime_management: []

6    samplingprofiler: []

7    diskstats: []

8    appwidget: [com.android.internal.appwidget.IAppWidgetService]

9    backup: [android.app.backup.IBackupManager]

10    uimode: [android.app.IUiModeManager]

11    serial: [android.hardware.ISerialManager]

12    usb: [android.hardware.usb.IUsbManager]

13    audio: [android.media.IAudioService]

14    wallpaper: [android.app.IWallpaperManager]

15    dropbox: [com.android.internal.os.IDropBoxManagerService]

16    search: [android.app.ISearchManager]

17    country_detector: [android.location.ICountryDetector]

18    location: [android.location.ILocationManager]

19    devicestoragemonitor: []

20    notification: [android.app.INotificationManager]

21    updatelock: [android.os.IUpdateLock]

22    throttle: [android.net.IThrottleManager]

23    servicediscovery: [android.net.nsd.INsdManager]

24    connectivity: [android.net.IConnectivityManager]

25    wifi: [android.net.wifi.IWifiManager]

26    wifip2p: [android.net.wifi.p2p.IWifiP2pManager]

27    netpolicy: [android.net.INetworkPolicyManager]

28    netstats: [android.net.INetworkStatsService]

29    textservices: [com.android.internal.textservice.ITextServicesManager]

30    network_management: [android.os.INetworkManagementService]

31    clipboard: [android.content.IClipboard]

32    statusbar: [com.android.internal.statusbar.IStatusBarService]

33    device_policy: [android.app.admin.IDevicePolicyManager]

34    lock_settings: [com.android.internal.widget.ILockSettings]

35    mount: [IMountService]

36    accessibility: [android.view.accessibility.IAccessibilityManager]

37    input_method: [com.android.internal.view.IInputMethodManager]

38    input: [android.hardware.input.IInputManager]

39    window: [android.view.IWindowManager]

40    alarm: [android.app.IAlarmManager]

41    vibrator: [android.os.IVibratorService]

42    battery: []

43    hardware: [android.os.IHardwareService]

44    content: [android.content.IContentService]

45    account: [android.accounts.IAccountManager]

46    user: [android.os.IUserManager]

47    permission: [android.os.IPermissionController]

48    cpuinfo: []

49    dbinfo: []

50    gfxinfo: []

51    meminfo: []

52    activity: [android.app.IActivityManager]

53    package: [android.content.pm.IPackageManager]

54    scheduling_policy: [android.os.ISchedulingPolicyService]

55    telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]

56    display: [android.hardware.display.IDisplayManager]

57    usagestats: [com.android.internal.app.IUsageStats]

58    batteryinfo: [com.android.internal.app.IBatteryStats]

59    power: [android.os.IPowerManager]

60    entropy: []

61    sensorservice: [android.gui.SensorServer]

62    media.audio_policy: [android.media.IAudioPolicyService]

63    media.camera: [android.hardware.ICameraService]

64    media.player: [android.media.IMediaPlayerService]

65    media.audio_flinger: [android.media.IAudioFlinger]

66    drm.drmManager: [drm.IDrmManagerService]

67    SurfaceFlinger: [android.ui.ISurfaceComposer]

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

Android Service命令的更多相关文章

  1. Android Service初始

    一.Service概念 1.Service是一个应用程序组件 2.Service没有图像化界面 3.Service通常用来处理一些耗时比较长的操作 4.可以使用Service更新ContentProv ...

  2. android adb命令 抓取系统各种 log

    getLog.bat: adb root adb remount adb wait-for-device adb logcat -v time > C:\log.txt 在Android中不同的 ...

  3. 【Android】详解Android Service

    目录结构: contents structure [+] Service简单概述 Service在清单文件中的声明 Service启动服务 Service绑定服务 扩展Binder类 使用Messen ...

  4. Android Service总结03 之被启动的服务 -- Started Service

    Android Service总结03 之被启动的服务 -- Started Service 版本 版本说明 发布时间 发布人 V1.0 添加了Service的介绍和示例 2013-03-17 Sky ...

  5. Android编译命令

    目录 说在前面 编译流程 编译指令 代码编译 代码检索 其他指令 说在前面 从最开始接触Android系统开始,每次进行代码编译都需要网上搜索编译指令.后来大致熟悉了Android的编译体系,加深了对 ...

  6. Linux service命令

    service命令(其实与其说是命令,不如说是脚本),因为service本身就是一个脚本,这个脚本在/sbin路径下,待后续shell脚本功底好了将去认真去看看这个脚本的内容(可不能被人忽悠了.) s ...

  7. android service两种启动方式

    android service的启动方式有以下两种: 1.Context.startService()方式启动,生命周期如下所示,启动时,startService->onCreate()-> ...

  8. 1、Android Studio集成极光推送(Jpush) 报错 java.lang.UnsatisfiedLinkError: cn.jpush.android.service.PushProtoco

    Android studio 集成极光推送(Jpush) (华为手机)报错, E/JPush: [JPushGlobal] Get sdk version fail![获取sdk版本失败!] W/Sy ...

  9. Android Service完全解析,关于服务你所需知道的一切(下)

    转载请注册出处:http://blog.csdn.net/guolin_blog/article/details/9797169 在上一篇文章中,我们学习了Android Service相关的许多重要 ...

随机推荐

  1. Springmvc中@RequestParam传值中文乱码解决方案(转)

    @RequestMapping(value={"/list"},method=RequestMethod.GET) @ResponseBody public DeviceList ...

  2. poj 1849 Two

    /*poj 1849 two 思考一下会发现 就是求直径 直径上的中点就是两个人分开的地方(不再有交集)*/ #include<cstdio> #define maxn 100010 us ...

  3. C# 内存管理优化畅想----前言

    C#语法简洁.优雅,类库丰富,是我最喜爱的计算机语言,没有“之一”.但是,经过深入学习后发现,C#的内存管理,也就是通常所说的垃圾回收(GC)机制,虽然跟其他支持GC的语言相比,已经很优秀了,但与手动 ...

  4. 客户端session与服务端session

    会话(Session)跟踪是Web程序中常用的技术,用来跟踪用户的整个会话.常用的会话跟踪技术是Cookie与Session.Cookie通过在客户端记录信息确定用户身份,Session通过在服务器端 ...

  5. treeview右键添加新节点

    private void advTree1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Righ ...

  6. Html5实现头像上传和编辑,保存为Base64的图片过程

    一.Html5实现头像上传和编辑 插件地址: html5手机端裁剪图片上传头像代码 本地项目引入注意事项: 1.将html的js搬到外面的js文件中,便于管理 2.图片样式在html都是在页面写死,需 ...

  7. OA系统权限管理设计方案学习

    学习之:http://www.cnblogs.com/kivenhou/archive/2009/10/19/1586106.html 此为模型图: 据此写了sql语句: drop table if ...

  8. busybox下mount nfs的命令

    busybox下mount nfs的命令 mount -f nfs -o nolock 10.130.30.2:/nfs/nuc970/rootfs /mnt/test

  9. 关于javascript延迟加载图片

    今天在技术群中,有位童鞋问起了javascript延迟加载图片的问题,我在这就给大家说明下原理和实现方法. 延迟加载是通过自定义属性,把真实的img地址存到自定义属性中,如data-url=”img” ...

  10. javascript DOM艺术

    一.DOM基础1.节点(node)层次Document--最顶层的节点,所有的其他节点都是附属于它的.DocumentType--DTD引用(使用<!DOCTYPE>语法)的对象表现形式, ...