Monday, December 12, 2016
Android Debug Bridge adb H®¡ÈÝng d¼Çn sÈ? dÈ´ng cÌÁc lÈành c®Á b¼£n
Android Debug Bridge adb H®¡ÈÝng d¼Çn sÈ? dÈ´ng cÌÁc lÈành c®Á b¼£n
1. K?t n?i: ci ??y ?? Drive cho my tnh (t?i ph?n m?m ci adb driver cho t?t c? cc dng my t?i ?y)
- T?i adb tools: http://www.fshare.vn/file/JXU5TIUE7IPS
- K?t n?i ?i?n tho?i v?i my tnh, b?t ch? ?? usb debug khi my cn b?t ???c, khi my khng kh?i ??ng ???c th vo recovery.
- N?u k?t n?i b?ng Charge only, ph?i ch?n Usb Debugging trong Developers options.
- Ch?y ADB_Tools
- Ki?m tra xem my ? k?t n?i ???c ch?a b?ng l?nh
adb devices
Tr??c khi ??c ti?p, c?n ch ?
- Khi ch?nh s?a nh?ng file h? th?ng, c?n remount l?i v?i quy?n read-write (ph?n 3)
- Khi g ???ng d?n, trong m?i tr??ng h?p t?t nh?t lun phn bi?t ch? hoa/th??ng, k? c? ???ng d?n trong Windows.
- N?u trong ???ng d?n c d?u "cch" (space) th ???ng d?n ph?i ?? trong ngo?c kp, v d?: D:moda.apk (ok); D: om moda.apk (khng ???c); "D: om moda.apk" (ok)
- C th? ko th? file vo c?a s? Command Prompt ?? l?y ???ng d?n c?a file ? lun.
- Trong ???ng d?n ??n file ho?c folder, c th? dng d?u sao "*" ?? ??i di?n cho m?t chu?i k? t? b?t k?, d?u h?i ch?m "?" ?? ??i di?n cho m?t k? t? b?t k?. V d? *.apk l ??i di?n cho t?t c? nh?ng file c ?ui l .apk. ?i?u ny c?n thi?t khi thao tc v?i nhi?u file (n?u ch?a r c th? xu?ng ph?n 4 ??c v d?).
2. L?nh c? b?n
- Copy file (folder) t? my tnh vo ?i?n tho?i: v d? file SystemUI.apk trong th? m?c "D: om mod" vo /system/app
adb push "D: om modSystemUI.apk" /system/app
- L?y file (folder) t? ?i?n tho?i ra my tnh: v d? SystemUI.apk t? /system/app ra D: om mod
adb pull /system/app/SystemUI.apk "D: om mod"
Ci file apk tr?c ti?p vo ?i?n tho?i: v d? ci RootExplorer.apk
adb install D:appRootExplorer.apk
N?u trong my c ci RootExplorer r?i m mu?n ci ? th
adb install -r D:appRootExplorer.apk
Ci vo th? nh? thay v b? nh? trong
adb install -s D:appRootExplorer.apk
L?y logcat: v l h??ng d?n c? b?n nn mnh ch? h??ng d?n l?y m?t ki?u. V d?: l?y logcat r?i l?u ra file a.txt cng th? m?c ch?a adb
adb logcat > a.txt[.CODE]
G l?nh xong ??i kho?ng 5s r?i ?n Ctrl + C ?? k?t thc.
[/LIST][LIST][*]Kh?i ??ng l?i:
[/LIST]
- Bnh th??ng
[CODE]adb reboot
- - Kh?i ??ng l?i vo bootloader- Kh?i ??ng l?i vo recoveryM:
adb reboot bootloader
- Kh?i ??ng l?i vo download modeM:adb reboot recovery
3. adb shell: th?c hi?n m?t s? l?nh c? b?n c?a linuxM:adb reboot download
Vo shell:M:adb shell[CODE]
M?i l?nh d??i ?y mnh ni ch? ch?y ???c khi b?n ? vo shell.
Ch ?: m?i l?nh trong shell c th? ???c dng nhanh t? adb:
[CODE]adb shell [l?nh_shell][CODE][LIST][*]Di chuy?n ??n th? m?c: v d? ??n /system/app
[CODE]cd /system/app - Danh sch file trong th? m?c hi?n hnh: v d? cc file trong /system/appM:
ls /system/app
- Quy?n root, ?? ch?nh s?a h? th?ng, nh? m?y v d? d??i mu?n s?a g trong /system ??u ph?i dng l?nh ny tr??cM:
su
- Mount v?i quy?n read-write: khi mu?n thay ??i g trong h? th?ng ph?i dng l?nh ny tr??cM:
mount -o remount,rw /system
- Copy: v d? /sdcard/a.apk mu?n copy sang /system/appN?u mu?n copy v?n file ??y sng /system/app nh?ng ??i tn lun thnh b.apkM:
cp /sdcard/a.apk /system/app
M:cp /sdcard/a.apk /system/app/b.apk
- Move: v d? t? /sdcard/a.apk ra /sdcard/external_sd/N?u mu?n move ??i tn lunM:
mv /sdcard/a.apk /sdcard/external_sd/
M:mv /sdcard/a.apk /sdcard/external_sd/b.apk
- Rename: v d? /system/app/a.apk sang /system/app/b.apkM:
mv /system/app/a.apk /system/app/b.apk
- Xo: v d? xo /system/app/a.apkXa t?t c? cc th? trong th? m?c system ko c?n bi?t c g bn trong:M:
rm /system/app/a.apk
M:rm -r /system/
- T?o th? m?c: v d? t?o th? m?c catlog trong /data/M:
mkdir data/catlog
- G? b? m?t ch??ng trnh ng??i dng ci ??t vo: ??n gi?n ch? c?n xo file t??ng ?ng trong /data/app. Nn k?t h?p v?i l?nh ls ?? xem danh sch fileM:
rm /data/app/UserApp.apk
- Ch?nh permission: v d? /system/app/SystemUI.apk sang 644 (rw-r-r)M:
chmod 644 /system/app/SystemUI.apk
- Thot: t? root ra shell ho?c t? shell ra adbM:
exit
- Copy ? file D:modSecPhone.apk t? my tnh vo ?i?n tho?i: