adb命令查看报名和查看手机分辨率

打开所要查看的应用包名:

$ adb shell dumpsys activity top | head -n 10
TASK com.ss.android.article.news id=5
ACTIVITY com.ss.android.article.news/com.ss.android.article.base.activity.DetailActivity 4407b468 pid=2714
Local FragmentActivity 42df3028 State:
mCreated=truemResumed=true mStopped=false mReallyStopped=false
mLoadersStarted=true
FragmentManager misc state:
mActivity=com.ss.android.article.base.activity.DetailActivity@42df3028
mContainer=android.support.v4.app.FragmentActivity$2@4231e9a0
mCurState=5 mStateSaved=false mDestroyed=false
View Hierarchy:

这里拿今日头条做样例能够看到它的包是com.ss.android.article.news,就无需反编译去看manifast.xml来找到其相应的包名了。

查看分辨率:

$adb shell dumpsys window | grep "ShownFrame" | head -n 1
mHasSurface=true mShowFrame=[0.0,0.0] [720.0,1280.0]

能够看到这里显示的分辨率为720x1280,这里也能够通过程序来获取。

上一篇:Java网络编程和NIO详解6:Linux epoll实现原理详解


下一篇:stark - 增、删、改