System UI 调试方法
来源:互联网 发布:大华淘宝客助手 编辑:程序博客网 时间:2024/05/21 04:43
工作需要想了解下SystemUi的启动流程,所以需要调试下SystemUI,这样比较高效:
1、SyStemUI是随系统启动的,所以我们先要在系统启动的时候把SystemUI的启动关掉,这个在SystemServer里面,可以如下注释:
static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); // context.startServiceAsUser(intent, UserHandle.OWNER); }
这样,系统起来或就看不到systemUI了,如果系统起来后没有systemUI进程,我们最好自己做一个应用,与systemUi在同一进程,这样方便调试onCreate等
2、现在SystemUi没有起来了,我们自己做一个测试例子,在里面启动SystemService,如下:
Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); // Slog.d(TAG, "Starting service: " + intent); context.startService(intent);
这样,我们就可以调试SystemUI这个APK了
调试过程中,发现这样调试还有一个问题,就是调试不到10s左右,adb调试跟eclipse自动断开了,这个是由于startService的超时导致ANR,我们可以针对这个调试把相应的ANR注释掉,在ActivityManagerService.java的appNotResponding方法中添加如下代码:
if(app.processName.equalsIgnoreCase("com.example.adbtool")) return ;
到这里,我们就可以正常的调试SystemUI了。
1 1
- System UI 调试方法
- System UI 调试方法
- ui结构查看和调试方法
- iOS UI 调试工具Reveal破解方法
- 解读System.Web.UI.Page中关键方法ProcessRequestMain()
- System.Web.UI.ScriptManager”的方法“get_EnableCdn”没有实现。
- 类型“System.Web.UI.ScriptManager”的方法“get_EnableCdn”没有实现
- 消除“Unfortunately, System UI has stopped”的方法
- 消除“Unfortunately, System UI has stopped”的方法
- 消除“Unfortunately, System UI has stopped”的方法
- System.Web.UI.ScriptManager”的方法“get_EnableCdn”没有实现
- 消除“Unfortunately, System UI has stopped”的方法
- System.Web.UI.Page
- System.Web.UI
- system UI分析
- System.Web.UI.HtmlControls
- System.Web.UI.WebControls
- Managing the System UI
- test10
- 将Vim改造为强大的IDE—Vim集成Ctags/Taglist/Cscope/Winmanager/NERDTree/OmniCppComplete(有图有真相)
- Windows7上搭建node和npm环境
- 0092 Java线程:Condition-线程通信更高效的方式【进阶】
- @@TranCount 之事务管理
- System UI 调试方法
- Cannot find executable for CFBundle
- Activity与Task
- 2014腾讯实习一面面试题
- SharpDevelop 使用笔记
- j_spring_security_check 404错误
- MySQL日期时间函数大全
- 类一定要定义拷贝构造函数,特别是在类成员含有指针的情况(不论指针是何种类型),安全!!!
- "对COM 组件的调用返回了错误 HRESULT E_FAIL"的解决方法