android

adb

adb version

Wifi

devices

adb devices
adb -s 192.168.88.39:42745 ls /  # `-s` if more than one device/emulator 

global options:
-e                       use TCP/IP device (error if multiple TCP/IP devices available)
-s SERIAL                use device with given serial (overrides $ANDROID_SERIAL)
-t ID                    use device with given transport id

Data Transfer

adb shell ls -hs /sdcard

# Download
adb pull -a /file_on_phone # -a: preserve file timestamp and mode
adb shell ls /sdcard/DCIM/Camera/*.mp4 | %{ adb pull -a $_} # powershell
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8    # powershell pipe中文乱码,fix `echo`, and some `pull`

# Upload
adb push foo.zip /sdcard/Download/        # file
adb push . /sdcard/Download/NewFolder     # folder

Debug

https://developer.android.com/studio/command-line/dumpsys.html#meminfo

adb shell dumpsys meminfo # http://i.imgur.com/DKsJ1Cb.png
adb shell getprop ro.build.ab_update # check if dual boot partition

fastboot

twrp

https://miuiver.com/how-to-flash-twrp/

apt install fastboot
fastboot devices
fastboot flash recovery twrp.img
fastboot reboot # hold [Vol-Up]

Apps

SSH Button

Automation

selendroid - JAVA

http://selendroid.io/

appium - nodejs

http://appium.io/ https://github.com/appium/sample-code/tree/master/sample-code/examples

Last updated