您的位置:首页 > 移动开发 > Android开发

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

2016-03-05 11:26 459 查看

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

首先需要将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

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


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

[b][b]adb
install  demo.apk
[/b][/b]

[b]Failure
[INSTALL_FAILED_ALREADY_EXISTS]
[/b]

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

[b]卸载一个手机上的程序[/b]

[b]adb
uninstall [包名]
[/b]


adb
uninstall com.coolweather.app

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


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

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

[b]ls 查看目录信息
 
[/b]

[b]ps 查看当前运行进程信息[/b]

kill
pid 杀死进程 


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

打开Process
Stats

adb shell dumpsys procstats
打开Meminfo
adb shell dumpsys meminfo
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android adb指令