adb 사용 방법

Tool 2015. 8. 18. 08:18


adb로 android 기기 접속 및 기기 확인


$ adb connect ip-주소

connected


$ adb devices

List of devices attached

192.168.219.152:5555 device




adb로 device 연결 해지


$ adb disconnect 




adb로 android shell로 이동


$ adb shell 





기기에 설치된 패키지 목록 읽기 및 삭제

삭제할 때 사용되는 키는 apk 명 뒤에 붙은 이름이 따로 있다. 해당 이름으로 사용한다.

$ adb shell 'pm list packages -f'

package:/data/app/eu.chainfire.stickmount-1.apk=eu.chainfire.stickmount

....


$ adb uninstall eu.chainfire.stickmount




기기에 안드로이드 앱 다운로드 하기


$ adb install  eu.chainfire.stickmount




로컬 파일을 안드로이드 기기로  복사 및 확인


$ adb push rotatelogs.c sdcard/

242 KB/s (12435 bytes in 0.050s)


$ adb shell 'ls -al /sdcard/rotatelogs.c'

-rw-rw-r-- root     sdcard_rw    12435 2014-08-29 11:11 rotatelogs.c





안드로이기 기기에서 로컬 디렉토리로 복사 및 확인


$ adb pull /sdcard/amazon.sdktester.json .

61 KB/s (1722 bytes in 0.027s)


$ cat amazon.sdktester.json

...




adb reboot를 바로 시작한다. 


$ adb reboot




adb를 이용한 파일/디렉토리 관리 명령 (조회, 삭제, 권한 생성)


$ adb shell 'ls -al /sdcard/'


$ adb shell 'rm /sdcard/rotatelogs.c'


$ adb shell 'mkdir /sdcard/tmp'


$ adb shell 'rm -rf /sdcard/tmp'


$ adb shell 'mkdir /sdcard/x1'





amazon fire tv의 /proc 파일 살펴보기


root@android:/ # cat /proc/version

Linux version 3.4.0-perf-g4c8a266 (e-scm@ip-10-225-169-130) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Jul 8 19:03:32 PDT 2015

root@android:/ # cat /proc/cpuinfo

Processor : ARMv7 Processor rev 0 (v7l)

processor : 0

BogoMIPS : 13.53


processor : 1

BogoMIPS : 13.53


processor : 2

BogoMIPS : 13.53


processor : 3

BogoMIPS : 13.53


Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt

CPU implementer : 0x51

CPU architecture: 7

CPU variant : 0x1

CPU part : 0x06f

CPU revision : 0


Hardware : LAB126 BUELLER

Revision : 0003

Serial : 0000000000000000

root@android:/ # cat /proc/meminfo

MemTotal:        1993512 kB

MemFree:          555700 kB

Buffers:           34484 kB

Cached:           726712 kB

SwapCached:            0 kB

Active:           466156 kB

Inactive:         691884 kB

Active(anon):     396864 kB

Inactive(anon):      416 kB

Active(file):      69292 kB

Inactive(file):   691468 kB

Unevictable:           0 kB

Mlocked:               0 kB

HighTotal:       1295356 kB

HighFree:          42708 kB

LowTotal:         698156 kB

LowFree:          512992 kB

SwapTotal:             0 kB

SwapFree:              0 kB

Dirty:                 8 kB

Writeback:             0 kB

AnonPages:        396848 kB

Mapped:           153596 kB

Shmem:               456 kB

Slab:              43624 kB

SReclaimable:      17784 kB

SUnreclaim:        25840 kB

KernelStack:       10400 kB

PageTables:        24480 kB

NFS_Unstable:          0 kB

Bounce:                0 kB

WritebackTmp:          0 kB

CommitLimit:      996756 kB

Committed_AS:    8870748 kB

VmallocTotal:     245760 kB

VmallocUsed:       86240 kB

VmallocChunk:      37892 kB

root@android:/ # cat /proc/devices

Character devices:

  1 mem

  4 /dev/vc/0

  4 tty

  5 /dev/tty

  5 /dev/console

  5 /dev/ptmx

  7 vcs

 10 misc

 13 input

 21 sg

 29 fb

 81 video4linux

 86 ch

 89 i2c

116 alsa

128 ptm

136 pts

166 ttyACM

180 usb

188 ttyUSB

189 usb_device

216 rfcomm

235 adsprpc-smd

236 ttyGS

237 avtimer

238 user-rc-input

239 BaseRemoteCtl

240 qseecom

241 kgsl

242 dia

243 msm_rotator

244 ttyHSL

245 ttyHS

246 msm_vidc_enc

247 msm_vidc_dec

248 msm_vidc_reg

249 bsg

250 smdpkt

251 smd

252 media

253 rtc

254 msm_sps


Block devices:

  1 ramdisk

259 blkext

  7 loop

  8 sd

 65 sd

 66 sd

 67 sd

 68 sd

 69 sd

 70 sd

 71 sd

128 sd

129 sd

130 sd

131 sd

132 sd

133 sd

134 sd

135 sd

179 mmc

254 device-mapper

root@android:/ # cat /proc/filesystems

nodev sysfs

nodev rootfs

nodev bdev

nodev proc

nodev cgroup

nodev tmpfs

nodev debugfs

nodev sockfs

nodev pipefs

nodev anon_inodefs

nodev rpc_pipefs

nodev devpts

ext3

ext2

ext4

squashfs

nodev ramfs

vfat

nodev nfs

nodev nfs4

nodev cifs

fuseblk

nodev fuse

nodev fusectl

nodev oprofilefs

root@android:/ # cat /proc/partitions

major minor  #blocks  name


   7        0      80680 loop0

 179        0    7634944 mmcblk0

 179        1       8192 mmcblk0p1

 179        2       8192 mmcblk0p2

 179        3      16384 mmcblk0p3

 179        4        128 mmcblk0p4

 179        5        256 mmcblk0p5

 179        6        512 mmcblk0p6

 179        7        512 mmcblk0p7

 179        8        512 mmcblk0p8

 179        9       1024 mmcblk0p9

 179       10      10240 mmcblk0p10

 179       11      10240 mmcblk0p11

 179       12      32768 mmcblk0p12

 179       13       1280 mmcblk0p13

 179       14       2752 mmcblk0p14

 179       15       6144 mmcblk0p15

 179       16          8 mmcblk0p16

 179       17       1024 mmcblk0p17

 179       18     786432 mmcblk0p18

 179       19     786432 mmcblk0p19

 179       20    5961878 mmcblk0p20

 179       64       4096 mmcblk0boot1

 179       32       4096 mmcblk0boot0

root@android:/ # cat /proc/uptime

455.07 851.96

root@android:/ # cat /proc/stat

cpu  15123 2109 8391 84748 21297 1 49 0 0 0

cpu0 5613 933 3758 14937 20100 1 40 0 0 0

cpu1 7520 654 3667 32636 1130 0 5 0 0 0

cpu2 973 297 562 18485 44 0 1 0 0 0

cpu3 1017 225 404 18690 23 0 3 0 0 0

intr 528300 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 143908 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 54 0 0 2685 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

ctxt 1489485

btime 1439852675

processes 4498



프로세스 정보 및 쓰레드 정보 보기


# ps -p


# ps -p -t



통신 상태 확인하기


# netstat




시스템 로그 및 안드로이드 로그 확인하기


# dmesg 


# logcat 




기타 정보 확인

http://developer.android.com/tools/help/adb.html






Posted by '김용환'
,