Android开发调试常用命令列表

adb命令

am

am start -n com.iflytek.autofly.account/.ui.MainActivity

am start -n com.android.settings/.Settings

am start "intent:#Intent;action=android.media.action.MEDIA_PLAY_FROM_SEARCH;\

S.android.intent.extra.focus=vnd.android.cursor.item%2Fartist;\

S.android.intent.extra.artist=Adele;end"

adb shell am start -n com.iflytek.autofly.speechclient/\

com.iflytek.autofly.settings.ui.OtherSubSettingActivity

adb shell am start -n com.iflytek.autofly.applist/.AppListMainActivity

adb shell am startservice -a com.iflytek.autofly.VoiceKey -e StartFrom HomeVoiceButton

am start "intent:#Intent;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;launchFlags=0x10200000;component=com.retton.h5/.WebActivity;S.title=%E6%97%A5%E6%9C%9F%2F%E6%97%B6%E9%97%B4;S.url=http%3A%2F%2Fwww.pingwest.com;end"

logcat

logcat | busybox grep `ps | busybox grep "com.package.name$"\

| busybox awk -F " " '{print $2}'`

logcat | busybox grep `ps | busybox grep "com.package.name$"\

| busybox awk 'NR%2==1{T=$2;next}{print T"|"$2}'

logcat | grep -E `ps |grep account| busybox awk 'NR%2==1{T=$2;next}{printf T"|"$2}'`

adb logcat -vtime -d > ~/Desktop/dump.log

其他

网络抓包命令

tcpdump -i usb0 -s0 -w /data/local/tmp/`date "+%Y%m%d%H%M%S"`.pcap

tcpdump -i usb0 -s0 -vv tcp port 80 and host hostname

monkey命令

monkey -p com.package.name --pct-syskeys 0 100000

查看包信息

dumpsys package com.test.package.name

系统命令

#打开wifi
adb shell svc wifi enable
#打开数据流量
adb shell svc data enable
#发送HOME按键事件
adb shell input keyevent HOME
#发送返回按键事件
adb shell input keyevent BACK

in gitbash:

adb push myfile //system/app/path.apk

通用

git

  #删除对文件的跟踪,会修改commit id,只在本地使用
git filter-branch --tree-filter 'rm -f testme.txt' HEAD

  忽略merge日志
  git log --no-merges

  查看从v2.6.12开始include/scsi和drivers/scsi目录中的改动的日志
  git log v2.6.12.. include/scsi drivers/scsi

  导出两周前开始的修改记录到文件gitk,“--”是为了避免和名为gitk的分支冲突
  git log --since="2 weeks ago" -- gitk

  查看test分支有但release分支没有的提交记录,并显示提交记录修改的路径信息
  git log --name-status release..test

  查看指定文件的修改记录,包含该文件被重命名等操作前的修改记录
  git log --follow builtin/rev-list.c

  本地有而远端没有的提交记录
  git log --branches --not --remotes=origin

  本地master分支有而远端master分支没有的提交记录
  git log master --not --remotes=*/master

  git log -p -m --first-parent

  Shows the history including change diffs, but only from the “main branch” perspective, skipping commits that come from merged branches, and showing full diffs of changes introduced by the merges. This makes sense only when following a strict policy of merging   all topic branches when staying on a single integration branch.

  git log -L '/int main/',/^}/:main.c

  Shows how the function main() in the file main.c evolved over time.

其他

keytool -list -v -keystore debug.keystore

keytool -printcert -file META-INF/CERT.RSA

jarsigner -verbose -keystore [keystorePath] -signedjar\

[apkOut] [apkIn] [alias] (给空白包签名)

jarsigner -verbose -verify -certs [apk]
aapt dump badging {PATH}.apk
iptables -I OUTPUT 1 -m hashlimit --hashlimit-name testup --hashlimit-above 5/s -j DROP

iptables -I INPUT 1 -m hashlimit --hashlimit-name testdown --hashlimit-above 5/s -j DROP

iptables -I INPUT 1  -m statistic --mode random  --probability 0.8 -j DROP

iptables --list

iptables -F
busybox find [PATH] -size +10000k
find /root -size -5557c -size +5555c -exec ls -ld {} \;
sudo mount -t vboxsf share /mnt
mount.cifs -o username=username /////////////////path to ci package
kill `ps | grep processname | busybox awk '{print $2}'`
												

最新文章

  1. IOS 杂笔-9 (MD5 加密)
  2. UML从需求到实现----包图
  3. JavaScript 弹出窗体点击按钮返回选择数据的实现
  4. hdoj 1253 胜利大逃亡
  5. 九度0J 1374 所有员工年龄排序
  6. lnmp安装--php与nginx结合
  7. 打印NSLog分类 Foundation+Log.m
  8. Web API之消息处理管道
  9. nyoj587 hdu1045 简单深搜
  10. 浅析c++/java/c#三大热门编程语言的运行效率
  11. 摘抄自知乎的redis相关
  12. 横向、纵向时间轴timeline系列
  13. 基于springboot搭建的web系统架构
  14. java日期转化,三种基本的日期格式
  15. 课下作业——MyCP
  16. 【linux】工作时使用的命令
  17. vue批量验证提交表单的数据是否合规
  18. boost.xml_parser中文字符问题 (转)
  19. 内核poll机制
  20. faiss CPU版本+GPU版本安装

热门文章

  1. 转:Fuzzing Apache httpd server with American Fuzzy Lop + persistent mode
  2. Luogu P2146 软件包管理器(树链剖分+线段树)
  3. JSON APIs and Ajax
  4. 解决PHPExcel列超过26的问题
  5. Spring中的设计模式2
  6. poj 1681(Gauss 消元)
  7. leetcode 576. Out of Boundary Paths
  8. javascript 检测浏览器类型和版本的代码
  9. 解决安卓TextView高度和textSize大小不一致问题
  10. Android获取wifi MAC,关闭的wifi不能获取