Posted on:
Last modified:
adb is pretty unstable, it's meant for debug usage, NOT for a long-running service.
install on ubuntu: apt-get install android-tools-adb android-tools-fastboot
install on mac: brew install android-platform-tools
there is a server on PC called adb server, if not started, will be started on first adb client call commands. there is an adbd daemon on phone, run as not root by default.
list all devices, give serial number for usb, and ip:port for wifi devices as adb id. if
only one device, all commands are issued to that device, if many, use adb -s ADB-ID
command to select a device.
first usb adb to the device
if rooted and run this on phone
su
setprop service.adb.tcp.port 5555
stop adbd && start adbd
if not rooted and run this on computer
adb tcpip 5555
adb connect ip:port
adb usb
# back to usb mode
adb pull phone_path pc_path
adb push pc_path phone_path
adb install
adb uninstall
adb shell pm clear PACKAGE_NAME # clears package data
adb forward local:port android:port
adb wait-for-device
adb forward host device
adb forward tcp:6100 tcp:7100
remounts the /system, /vendor (if present) and /oem (if present) partitions on the device read-write
adb shell dumpsys activity | grep mFocusedActivity
pm
setprop/getprop
netcfg
screencap
screenrecord
error closed: 可能是权限不够,执行了 n 权限过高的操作,需要首先执行 adb root
能用 ssh,就用 ssh,不要用 adb
https://github.com/jackpal/Android-Terminal-Emulator/wiki/Android-Shell-Command-Reference http://forum.xda-developers.com/showthread.php?t=1694251 http://forum.xda-developers.com/wiki/Guide%3aUsing_the_Terminal#SSHD http://www.kpbird.com/2013/05/android-shell-command-pm-package-manager.html
termux
The error message is no such file of directory, which is quite miss-leading
apk 没有权限 应该 777 apk 有证书不一致的 卸载旧的 apk
[1] https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html
从手机上拉取已安装应用的 apk 文件
adb shell pm path com.example.someapp
adb pull /data/app/com.example.someapp-2.apk
© 2016-2022 Yifei Kong. Powered by ynotes
All contents are under the CC-BY-NC-SA license, if not otherwise specified.
Opinions expressed here are solely my own and do not express the views or opinions of my employer.
友情链接: MySQL 教程站