android玩耍(-) adbshell安装

时间:2024-05-30 13:33:32

一 什么是adbshell

 http://adbshell.com/
 Android Debug Bridge (adb) is a command line tool that lets you communicate with an emulator or connected Android device. 

  adb 是一个帮你与andriod模拟器或真机通信的CLI工具. adbshell 就是集成了adb工具包的shell接口.shell是什么就不啰嗦了.直接上干货 .

二 adbshell 安装

  手机端:打开use调试模式,4.x版本以后多次单击版本号,触发隐藏选项,单选usb debugging,允许usb debug. usb连接电脑允许电脑端调试,电脑指纹识别确认.

  电脑端:安装usb驱动.

http://adbshell.com/downloads

安装完在devmgmt.msc 能识别设备.

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVgAAAA5CAIAAAD80aRcAAALLklEQVR4nO2dW2wbWRnHRxVaxMuyZalgWVWLVGiBaqXuw0oM1SrSitsTWbRItA8Vl9KBLgWkKKutstVGhRIidZcJrRbSpmXJxYnrXJyLM3EviZPaThu3dhzHTp04NGmpkyo3Lm3ZkIQdHuzxnDPnnBmb2rU9+X7yQ+w55zvHM/n+850z53zmDh8+LAMAsLnhQAgAAAAhAAAAhAAAgLwLwdLi/YlwQHn5I+P+yLg/HPKNh3zjYyOhsetjwWtjo8O3boXz2EkAMD15FoKJcKC+/i+JV2NDvcXS2NJisdvburrsvY4up9Nx5bI0Nup19vXksZMAYHoKQgg4rp172sNtneK2/evn1fJAWLYNy80e+YNB+T37ejDg7XV0Zb9tSeB4MZZ++ZjIUytkYCfTJgHgCVEQQrDlGSv36YvcjiD33N3vH1mdnZOjs/J0XL67KF+P/DcY8HR323XNxESe4wQps7ZzKwQxkedSKF0DIQAKlLwLgb+xsX7Hi9antrVyz1/lPhf54qsLjqGP+n2yc0QeHJVbXRujAbe9o03PSkzkeZ7PVAmy5ZVMIVA+VRUEhAAoUJ6EELhcrurqauqhSDjQ1NTwyjfbntlez21t5z478PSXRk+e/YfV8eGfO/7T0vvRKcvqaOBqW5tNx37C5yQhQyV4YkKgFgEhAAqUnAtBf3//7t27d+7cST0aGb9ps1lfLr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RI3NmMgzNiwmFEBNnsCLsZQ2GIQrqR16VHmhJWMAzEluhWBhYaGuru7evXvp13K5XLbzVm/PwIXGlmu+sfn5FZvN6fONLAQvdXeTP1JglPeKsvVUr0qyGpnyI+1G2SXVZFpGGTdiqSSB2p36tIpJp1fiejV9ARpUEDMHaOSf+IOIEghAEMxLboVAluWlpaWampqpqSn9whsbG1Ox6bFQ+NLl/tra2vf/9Ee3eygen5NleSH+t2t9nvI3yyORCFFP1yfpUYCBG2O37WwIAcWNDDLnIEmENP2nVcR8XJBSo3kyHFDnAPBvSkQEyXELKyICzEfOhUCW5fn5+ePHj6+srFCLxePz4fAt7/DIndk7y4uLf19e9riv1vxB7OnpfvDgwaNHj0KhscrKd5xOJ6021SfRZBWaHDtGVTRJRDIQAnU0gbg9Y6DCFAJNLSWIMA5SkmZ5MYbMY3DaWRIhYUvr/jEl6TgSLqg2ISLYDORcCJaXl3UiAp/P7+y70ml3aF7NFmvdufOnTp2qqamprT3T2GBx9l3x+fyEAcIncVdJHMYL6VVhDBIya5RREst4ZTxHgEQl6swAqyFJSOTUUYQgWQ671SOZupLiiHzrlO5gYgAqsGnIrRAsLi7qzxGUlVW4XJ7IhN4CgckPRyYmJoeuDpeVVRAH9RLgKcc1E/A6VbQeHqOnDzRqlNE9ZJKAsEw8NcBzm+kEKepDC+XGjv60EDrvgLi2IGmymikGsMeHyENDeHxocvL81KCsrOKisz8yEZX6hjSv6GQ8OhkvLz/6g8E9P/7Jwa7OXpYQ6N61tB6nV4U6e07J62fYKNYWoiyYu+uvI6CPZHSHBgl/prus0paS6k87ZQERwSYnz+sIysoqOu2O8vKjhw79TPMqLz8anYz/4vc/fH3hE6+99nqn3UETgmxStA/KUv5KX1lIDEKwyQikBEQEm5f/AfqEgzDesPmDAAAAAElFTkSuQmCC" alt="" />

安装adbshell

http://files.cnblogs.com/files/liuyuxing/adb.zip

加入到环境变量.cmd进入.

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbgAAAAyCA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VuSlJSXBs4WhVlY9odXFzCSbgnd5/r3T0+9FvpSbvXz92pmQACEOW9RPntizsBvAVEeS9RAkAHdxclAECRO4uSPlwAqOJmogwe0cVDtenTBQCVm4nyIcfP7KLs7QkGgHtwP1EeI132lTcK6xMhUYB78z/g96Uk7S8QSQAAAABJRU5ErkJggg==" alt="" />

如此,则恭喜你已经通过adbshell 连接到手机了

三 练手命令

打开cmd

adb devices 列出连接设备

adb kill-server 干掉adb进程

adb forward 12223 75360 设置adb 通信端口本地12223 对端75360

adb usb 重启端口,等于断开usb重连

adb tcpip xxx 通过ip地址连接

adb install xxx.apk  安装xxx.apk -t 允许调试 -s 安装在sdcard -d 允许降级

adb unistall xxx.apk 卸载  -k 保留文件

shell >pm list packages 列出所有已安装包 可以用管道符

  pm path com.mt.mtxx.mtxx  列出美图秀秀的安装路径

  pm clear com.mt.mtxx.mtxx  清除美图的data

  pull 下载数据

  push 上传数据

  ls /rm /mkdir /touch /cp /mv /pwd /cd 跟bashshell 类似

  netstat /ip/ netcfg 类似bsh

  logcat  打印log ,

  ***貌似只能发送ctrl-c 的quit signal退出

  dumpsys   //dumpsys battery 查看电池信息

  dumpsys meminfo

  dumpsys data

  dumpsys dumpsys activity

  dumpsys gfxinfo com.mt.mtxx.mtxx  查看美图信息

  screencap /sdcard/screen.png  屏幕截图

  screenrecord --size <WIDTHxHEIGHT>  录屏

  adb root  以root权限进入adb

  adb sideload <update.zip> 系统更新

  ps /top /

  getprop | grep adb  查看adb属性设置

  setprop service.adb.tcp.port 5555  设置adb端口号

四 .应用场景

  模拟向手机发送home 按键,破解密码, 打印log进行调试等等.本人没有具体应用过,这里就不丢丑了.

本站博客皆为原创,转载请标明出处.小三爷在此谢过了~~!