Android学习笔记----常用adb指令

来源:互联网 发布:社会调查数据 编辑:程序博客网 时间:2024/04/28 15:59

/*********************************************************************************************************************/

首先需要将adb配置到环境变量里面,网上相关操作很多,就不介绍了。

adb 的文件操作:
把一个文件拷贝到手机内存
adb push [源文件] [目标文件] 

adb push C:\Users\YAN\Desktop\haha.txt /mnt/sdcard/haha.txt

把一个文件从手机内存拷贝到桌面
adb pull [源文件] [目标文件]

adb pull /data/app/ApiDemos/ApiDemos.apk C:\Users\YAN\Desktop\haha.apk

/*********************************************************************************************************************/

[2012-03-09 10:33:00 - ddms]transfer error: Invalid argument
[2012-03-09 10:49:49 - DeviceMonitor]Adb connection Error:远程主机强迫关闭了一个现有的连接。
[2012-03-09 10:49:50 - DeviceMonitor]Connection attempts: 1
[2012-03-09 10:49:52 - DeviceMonitor]Connection attempts: 2
[2012-03-09 10:49:54 - DeviceMonitor]Connection attempts: 3
[2012-03-09 10:49:56 - DeviceMonitor]Connection attempts: 4
[2012-03-09 10:49:58 - DeviceMonitor]Connection attempts: 5
[2012-03-09 10:49:59 - DeviceMonitor]Connection attempts: 6
[2012-03-09 10:50:01 - DeviceMonitor]Connection attempts: 7
[2012-03-09 10:50:03 - DeviceMonitor]Connection attempts: 8
[2012-03-09 10:50:05 - DeviceMonitor]Connection attempts: 9

adb 连接的调试桥的socket出现了错误
1. adb kill-server
2.  adb start-server

/*********************************************************************************************************************/


把电脑上的某个应用装(. apk)到模拟器或者手机里面  

adb install  demo.apk

Failure [INSTALL_FAILED_ALREADY_EXISTS]


adb install C:\Users\YAN\Desktop\coolweather-debug.apk

卸载一个手机上的程序

adb uninstall [包名]


adb uninstall com.coolweather.app



/*********************************************************************************************************************/


adb devices 查看当前所有连接上来的设备信息 

adb shell 来到模拟器或者是真机的控制台 


ls 查看目录信息  

ps 查看当前运行进程信息

kill pid 杀死进程 


/*********************************************************************************************************************/

打开Process Stats
adb shell dumpsys procstats
打开Meminfo
adb shell dumpsys meminfo










0 0
原创粉丝点击