adb

getting error while using “su” command

点点圈 提交于 2020-01-12 18:44:09
问题 I try to make batch file to run adb commands. I want to use su -c , but I get the error: su: invalid uid/gid '-c'. I saw somewhere that my su version doesn't support -c , how can I enable this? 回答1: In batch file it should be like this: adb shell "su 0 <command args>" For example: adb shell "su 0 mount -o rw,remount /system" 回答2: The standard Android su is much simpler than its regular linux counterpart. It does not support any commands other than -c - so it's become redundant. usage: su [UID

Cannot adb pull database even after chmod 777 on my device

[亡魂溺海] 提交于 2020-01-12 18:44:09
问题 I am unable to pull a the database from the device even after changing the permission. I have a rooted phone. It used to work. I could pull before. For some unknown reason now I cannot. The error I receive is remote object '/data/data/com.thuptencho.transitbus/databases/ttc.db' does not exist Does anybody know why this is happening? Below is what I did in command window. C:\users\thupten>adb shell shell@android:/ $ su su root@android:/ # cd /data/data/com.thuptencho.transitbus/databases/ cd

Keyevent to click on Alert Dialog of Android screen

∥☆過路亽.° 提交于 2020-01-12 10:19:54
问题 Is there any way to simulate keyevent on "OK" or "CANCEL" buttons of Android dialogue box using adb commands? 回答1: One indirect way is:- adb shell uiautomator dump /data/view.xml adb shell cat /data/view.xml calculate OK button coordinates from the relative coordinates given in the xml file. Then do adb shell input tap <x> <y> Hope works. 回答2: Using AndroidViewClient/culebra you can simply do: run java -jar androidviewclient-2.3.25.jar culebra --verbose --verbose-comments --find-views-with

apk的性能指标

≡放荡痞女 提交于 2020-01-11 23:41:42
apk关键性能参数 1、包体大小(M) 2、falsh读写 3、内存占用(M) pss---adb shell dumpsys meminfo 包名 4、cpu占用(%) adb shell top -n -1 | find "包名" 4、卸载后是否有残留 ---外部存储---/mnt//sdcard/Android/data/包名 ---内部存储---/data/data/包名 5、应用退出后是否驻留后台进程 pid---进程号 来源: https://www.cnblogs.com/zx1313/p/12181470.html

Where is adb.exe in windows 10 located?

瘦欲@ 提交于 2020-01-11 14:59:39
问题 I installed android studio 1.5 on windows 10. When I type in command line: adb I get command not found. Where can I get it from or where is it installed? 回答1: it is located in AppData hidden folder C:\Users\[user]\AppData\Local\Android\sdk\platform-tools From l33t's comment below %LOCALAPPDATA%\Android\sdk\platform-tools 回答2: You can find it here: %USERPROFILE%\AppData\Local\Android\sdk\platform-tools To save yourself the hassle in the future, add it to your path: Click 'Start'. Type 'Edit

电量优化 之 导出Bugreport日志

情到浓时终转凉″ 提交于 2020-01-11 14:21:51
安卓手机为了调试方便有个叫bugreport的东西,可以记录很多日志。上一篇讲了看这个日志的工具如何安装: 电量优化 之 Battery Historian安装 这一篇记录一下bugreport的生成与导出。测试手机:安卓手机7.0以上 抓取日志 电脑上装个ADB,只装ADB就行,配下path,这样在任何路径都能直接用adb。SDK很大很大 打开调试模式,在关于手机里多按几遍版本号,把开发者模式弄出来 在开发者模式中打开调试 手机连上电脑,选择传输文件 打开CMD窗口 下面是命令集时间: a. 重置电池统计信息和历史记录 adb shell dumpsys batterystats --reset b. 获取详细的wakelock数据,中文是唤醒锁,要有应用拿着这个锁,CPU就无法进入休眠状态,一直处于工作状态。比如,手机屏幕在屏幕关闭的时候,有些应用依然可以唤醒屏幕提示用户消息,这里就是用到了wakeloc锁机制,虽然手机屏幕关闭了,但是这些应用依然在运行着。这个开关打开后,尽量别开太久,理由是:日志太大受不了。 adb shell dumpsys batterystats --enable full-wake-history --启用 adb shell dumpsys batterystats --disable full-wake-history --关闭 c. 抓取日志

Android Studio's device chooser is shown before Gradle Build completes

好久不见. 提交于 2020-01-11 08:27:10
问题 Prior to Android Studio 1.5, the device chooser was shown upon Gradle Build completion. This allowed to use build time to physically configure devices, make any last minute changes or to ensure that devices were actually connected at the time of install. I also disconnected devices if I wanted to cancel my gradle run without interrumpting my workflow. With the device chooser showing before Gradle Build completion I am forced to have my devices physically connected before starting my build;

Can't run adb commands in bash script

被刻印的时光 ゝ 提交于 2020-01-11 07:11:09
问题 I'm trying to launch Android tethering settings from adb shell. The main purpose of doing so is to enable USB tethering mode by running a shell script. I'm using the following set of commands on my Ubuntu Terminal (12.04): adb shell am start -n com.android.settings/.TetherSettings sleep 7 input tap 162 159 input tap 385 607 This method works fine when the commands are executed one by one, but I'm not able to run them as normal shell script. Please help! Here is the complete script: #!/bin/sh

【Python】Camera拍照休眠唤醒测试

末鹿安然 提交于 2020-01-10 13:58:35
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import sys import time rebootCount = int(input("请输入测试次数:")); print ("你输入的次数是: ", rebootCount) def copyright(): print("\n") print("Lenovo R&T automated testing script version 0.1") def usage(): print("Usage : python " + sys.argv[0]) print(" Please turn on the device and make sure that you can use ADB Command.") print("\n") def find_device(): # os.system('adb kill-serve') # os.system('adb start-server') # os.system('adb root') # os.system('adb remount') print("adb devices") os.system('adb devices') def open_camera(): print("打开相机:") os.system(

在Ubuntu14中adb 不能检测OnePlus One的解决过程

你。 提交于 2020-01-10 11:24:38
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 最近在学习Android的开发,且对于linux平台很有兴趣,随即将学习开发Android的平台搭建在了Ubuntu14.04 LTS中。但是却在一开始的时候就遇到了十分棘手的问题——使用eclipse不能连接到我的真机测试,即Oneplus One。 没有办法,只有慢慢尝试开始解决这一问题。 1.首先是发现并没有在/ect/udev/rules.d/ 下创建有51-android.rules。 接着在 Using Hardware Devices 中的 Setting up a Device for Development 找到了如何添加udev rules的方法。 1.1 首先是将手机开启了Usb 调试后,连接电脑 1.2 打开Ubuntu终端 sudo lsusb Bus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 014: ID 09da:054f A4 Tech Co., Ltd Bus