adb

【烂笔头】adb命令篇

跟風遠走 提交于 2020-01-21 15:35:58
前言 Android的adb提供了很多命令,功能很强大,可以为开发和调试带来很大的便利。当然本文并不是介绍各种命令的文章,而是用于记录在平时工作中需要经常使用的命令,方便平时工作时使用,所以以后会持续新增一些常用而且很有用的命令。也希望这些命令能给读者带来一定的帮助。 当前已经记录的命令主要涉及到如下功能: 一、常用的与Permission相关的adb命令 二、通过Wifi连接连接手机 三、adb操作四大组件 四、实现一个操作多条adb命令的脚本 五、用adb dump一些信息 六、adb与进程 一、 常用的与Permission相关的adb命令 Android工具adb提供了一些命令,可以方便查看、授权、取消应用的权限,可以为调试程序带来不少的方便,下面简单介绍几个常见的命令。 1、查看指定app中权限申请情况 命令:adb shell dumpsys package [包名] 用途:该命令用于获取该app的package信息,Permission信息只是其中的一部分。 命令使用示例: 1 adb shell dumpsys package cn.aaa.bbb 如下下截图为该命令中关于权限的部分信息: 该图显示了4部分权限: (1)declared permissions。该应用自己声明(即自定义)的权限,这里显示了权限名,权限等级,以及在什么时候获取该权限(INSTALLED

配置adb环境与简单命令

时间秒杀一切 提交于 2020-01-21 14:14:23
adb命令具有安装卸载apk,拷贝推送文件,查看设备硬件信息,查看应用程序占用资源,在设备执行shell命令等 客户端:通过adb调用客户端 服务器server:运行后台,负责客户端与进程进行通信 守护进程:运行在模拟器或手机端 adb dervices 检测连接到电脑的安卓设备,这个是我们经常会用到的检测命令 adb pull 手机路径 本机路径 从手机中拉取信息放到本地电脑 adb push 本机路径 手机路径 从本地推送信息到手机上去 adb shell 登录设备shell adb logeat 打印日志 输出文件中>(重镜像)目录 adb uninstall 包名 adb comnect 127.0.0.1:端口号 连接手机 android log 输出量巨大,特别是网络通讯 1.安装adk https://android-sdk.en.softonic.com/ 2.下载完后配置adk环境,打开计算机 3.新增android变量 变量值为下载sdk中的platform-tools中 4.path中加入android变量 %android% 5.保存cmd命令打开命令行输入adb这样就成功啦 来源: https://www.cnblogs.com/cheng10/p/10643402.html

adb学习笔记

天大地大妈咪最大 提交于 2020-01-21 14:14:11
一、adb实现原理 adb的目的是想 仅在PC端执行adb操作 来获取手机里面的文件或向手机内部发送文件。这是通过Ubuntu中adb操作作为客户端与Ubuntu中运行的adb service交互,Ubuntu中运行的adb service与手机中运行的adbd守护进程交互实现的。 设备端(eg:手机)在启动后会启动一个名为adbd的守护进程,来监听PC通过adb发来的请求。Ubuntu中默认是不会启动启动adb服务的,但是执行adb devices的时候若是adb server还没有启动,就会通过"adb -P 5037 fork-server server"来启动adb服务服务。此后,Ubuntu中运行adb就作为client向Ubuntu中的adb service发起请求,然后Ubuntu中的adb server与手机里面的adbd守护进程通信。 二、adb操作 1.Ubuntu要获取手机中的一个文件: # adb devices * daemon not running. starting it now on port 5037 * 执行的时候adb server还没有运行,然后就启动adb server。 * daemon started successfully * List of devices attached FA4412DBA4120433 device

android adb介绍

扶醉桌前 提交于 2020-01-21 14:13:48
1. 什么是adb 在SDK的Tools文件夹下包含着Android模拟器操作的重要命令ADB,ADB的全称为Android Debug Bridge,就是调试桥的作用。可以与模拟器或android设备通信。adb可分为三部分: 客户端:运行在pc机上,通过console调用 adb 命令。其他工具,如ADT插件 和 DDMS工具等,都会调用adb客户端。 服务器:运行在pc机上,以后台程序方式运行。负责客户端与adb 守护进程(deamon)之间的通信。 adb 守护进程(deamon):运行在android设备或模拟器上。 adb工具放在android_SDK/platform-tools/下。启动adb客。户端后,会首先检测服务器是否已启动。未启动起会将服务器自动起起来,服务器绑定在tcp 5037端口。服务器会扫描5555 to 5585端口段来发现adr设备。当发现adb守护进程后,会建议连接。注意,每个连接会占用两个端口,双数端口用来响应console,单数端口用来adb连接。如,设备1,console: 5554; 设备1,adb: 5555。 2. 启动adb 我使用adb安装apk时,提示: adb server is out of date. killing... ADB server didn't ACK * failed to start daemon *

Non-exported activities: launched on emulators; SecurityException on phones

限于喜欢 提交于 2020-01-21 11:35:34
问题 I have a non-exported activity in my project. If I try to launch it on my phone using adb : adb shell am start -n "packagename/activityname" I get the error: java.lang.SecurityException: Permission Denial: starting Intent { ... } from null (...) not exported from uid ... But, if I run the same command on an emulator, then everything works Okay. How comes? 回答1: But, if I run the same command on an emulator, then everything works Okay. How comes? An emulator instance runs as root by default,

安卓手机用ADB命令打印APP的崩溃日志

≡放荡痞女 提交于 2020-01-21 03:05:03
很多APP在测试的时候没有加上打印实时日志的功能导致闪退的日志没法查询,我经常的做法是用手机通过USB连接电脑,打开USB调试模式 使用ADB命令: 1)打印手机的崩溃日志 adb shell dumpsys dropbox | findstr data_app_crash 打印具体时间的崩溃日志 2)adb shell dumpsys dropbox --print 11:35:53>E:\log.txt E:\log.txt 为本地电脑的保存路径,崩溃日志打印在E盘的log.txt里 来源: CSDN 作者: 小五很懒 链接: https://blog.csdn.net/qq_40126958/article/details/104051287

adb操作

落爺英雄遲暮 提交于 2020-01-21 02:33:03
玩转ADB命令(ADB命令使用大全) adb 操作剪贴板 辅助工具:Clipper 使用:首先启动 service adb shell am startservice ca.zgrs.clipper/.ClipboardService 设置剪贴板内容: adb am broadcast - a clipper . set - e text "this can be pasted now" 获取剪贴板内容: adb am broadcast - a clipper . get 来源: CSDN 作者: 阿里恒恒 链接: https://blog.csdn.net/binbin594738977/article/details/104055283

android: Recursive copy with adb push

限于喜欢 提交于 2020-01-20 12:54:59
问题 I think adb's push is file-based. I want to be able to push entire folders. Is there an easy way without scripting? Thanks! Edit: I need to work with sub-folders. Edit: Seems that adb pull is recursive but push is not. So I changed the title and description accordingly. 回答1: Try this (worked with subfolders): adb push mySourceFolder/. myDestAndroidFolder . Empty folders do not copy to android device. 回答2: adb pull, pulls all the files in the specified directory: $ adb pull /mnt/sdcard/ pull:

android: Recursive copy with adb push

三世轮回 提交于 2020-01-20 12:53:31
问题 I think adb's push is file-based. I want to be able to push entire folders. Is there an easy way without scripting? Thanks! Edit: I need to work with sub-folders. Edit: Seems that adb pull is recursive but push is not. So I changed the title and description accordingly. 回答1: Try this (worked with subfolders): adb push mySourceFolder/. myDestAndroidFolder . Empty folders do not copy to android device. 回答2: adb pull, pulls all the files in the specified directory: $ adb pull /mnt/sdcard/ pull:

Android app installation: Unknown failure (Failure - not installed for 0)

本秂侑毒 提交于 2020-01-20 01:17:48
问题 Application works fine on emulator, but I can't launch application on my device (Xiaomi Mi4). At first i seed dialog with such text: Installation failed with message Failed to establish session. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing. WARNING: Uninstalling will remove the application data! Do you want to uninstall the existing application? But after I agree - i see in log this message: Launching app $