Useful ADB shortkeys
Android Debug Bridge(ADB) is CLI tool which communicate with device.
Android SDK Platform includes ADB package.
- Move directory
adb shell cd "path"
- Reboot device
adb reboot
- Show connected devices
adb devices
- Start server
adb start-server
- Kill server
adb kill-server
- Exectue command to specific device
adb -s "example device name" "example command"
- Connect wifi (Available Under Android 10)
adb connect "example device ip address"
- Move file to device
adb push "example local file" "example device directory"
- Take device file to local
adb pull "example device file" "example local directory"
- Get writing and reading permission
adb shell mount -o remount,rw /system
- Turn on wifi
adb shell svc wifi enable
-Turn off wifi
adb shell svc wifi disable
- Turn on mobile data
adb shell svc data enable
- Turn off mobile data
adb shell svc data disable
- Change device's date
1) adb shell "su 0 toybox date 042523592021.59"
(toybox date use MMDDhhmm[[CC]YY][.ss] format)
2) adb shell "su 0 toolbox date -s 20210425.235959"
(toolbox date use YYYYMMDD.HHmmss format)
- Symbolic link
adb shell ln -sf "example original file" "example target file"
- Show system property list
adb shell getprop
- Start activity
adb shell am start -a android.intent.action.MAIN -n "example/package/activity_name"
- Start service
adb shell am startservice -n "example/package/service_name"
- Start broadcast
adb shell am broadcast -a "example broadcast name"
- Start Broadcast extra
1) adb shell am broadcast -a $(example_action_name) -es ${example_extra_key} ${example_extra_string_value}
2) adb shell am broadcast -a $(example_action_name) -ez ${example_extra_key} $(extra_boolean_value)
3) adb shell am broadcast -a $(example_action_name) -ei $(example_extra_key) $(example_extra_int_value)
- Verify specific package's PID
adb shell pidof "example package name"
-Kill Process
adb shell am force-stop "example package name"
adb shell kill -9 PID (Available only if root)
- Show installed packages
adb shell cmd package list packages
- Find package's path
adb shell pm path "example package name"
- Screen capture
adb shell screencap -p /sdcard/Download/"example file name"
adb pull /sdcard/Download/"example file name" "local directory"
- Remove file
adb shell rm "example file"
- Remove directory
adb shell -r "example file"
댓글 없음:
댓글 쓰기