Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

of

Android - ADB Slide 1 Android - ADB Slide 2 Android - ADB Slide 3 Android - ADB Slide 4 Android - ADB Slide 5 Android - ADB Slide 6 Android - ADB Slide 7 Android - ADB Slide 8 Android - ADB Slide 9 Android - ADB Slide 10 Android - ADB Slide 11 Android - ADB Slide 12 Android - ADB Slide 13 Android - ADB Slide 14 Android - ADB Slide 15 Android - ADB Slide 16 Android - ADB Slide 17 Android - ADB Slide 18 Android - ADB Slide 19 Android - ADB Slide 20 Android - ADB Slide 21 Android - ADB Slide 22 Android - ADB Slide 23 Android - ADB Slide 24 Android - ADB Slide 25 Android - ADB Slide 26 Android - ADB Slide 27 Android - ADB Slide 28 Android - ADB Slide 29 Android - ADB Slide 30 Android - ADB Slide 31 Android - ADB Slide 32 Android - ADB Slide 33 Android - ADB Slide 34
Upcoming SlideShare
ADB(Android Debug Bridge): How it works?
Next
Download to read offline and view in fullscreen.

18 Likes

Share

Download to read offline

Android - ADB

Download to read offline

Android ADB

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Android - ADB

  1. 1. Android ADB
  2. 2. Hello!I am Yossi Gruner
  3. 3. Agenda ▣ what is adb ▣ adb commands ▣ adb scripts ▣ adb files ▣ adb over WiFi ▣ screen capture/record ▣ logcat ▣ shell command □ am □ pm □ dumpsys □ more…
  4. 4. What is ADB
  5. 5. What is ADB ▣ Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device.
  6. 6. 3 elements of ADB ▣ adb clients □ executable with subcommand □ ”adb shell”, ”adb logcat” : the end point of host side ▣ adb server □ running on host on back-ground □ act as proxy between adb clients and adbd ▣ adb daemon (adbd) □ running on target device □ started by init, if die, restarted by init again
  7. 7. How it connect
  8. 8. How it connect
  9. 9. ADB Commands ▣ adb devices □ Print All the connected devices ▣ adb shell □ run remote shell interactively ▣ adb jdwp □ list PIDs of processes hosting a JDWP transport ▣ adb install/uninstall □ un/install the application ▣ adb start-server □ ensure that there is a server running ▣ adb kill-server □ kill the server if it is running
  10. 10. Adb scripts ▣ adb wait-for-device □ block until device is online ▣ adb start-server □ ensure that there is a server running ▣ adb kill-server □ kill the server if it is running ▣ adb get-state □ prints: offline | bootloader | device ▣ adb get-serialno □ prints: <serial-number> ▣ adb get-devpath □ prints: <device-path>
  11. 11. Adb scripts ▣ adb status-window □ continuously print device status for a specified device ▣ adb remount □ remounts the /system and /vendor (if present) partitions on the device read-write ▣ adb reboot [bootloader|recovery] □ reboots the device, optionally into the bootloader or recovery program ▣ adb reboot-bootloader - □ reboots the device into the bootloader ▣ adb root □ restarts the adbd daemon with root permissions ▣ adb usb □ restarts the adbd daemon listening on USB
  12. 12. Adb - Files ▣ Copy file to device □ adb push <local> <remote> ▣ Copy file from device □ adb pull <remote> <local>
  13. 13. adb over WiFi ▣ Android Device □ adb shell netcfg  get the android IP address (x.x.x.x) □ adb shell setprop service.adb.tcp.port 5555 □ adb shell stop adbd && start adbd ▣ PC device □ adb connect x.x.x.x □ adb -s x.x.x.x:5555 logcat □ adb -s x.x.x.x:5555 logcat |grep -vE "/dalvik" □ adb -s x.x.x.x:5555 shell
  14. 14. BugReport ▣ Command □ adb shell bugreport > bugreport.txt □ java -jar chkbugreport.jar bugreport.txt ▣ JAR download □ https://github.com/sonyxperiadev/ChkBugReport/download s
  15. 15. ScreenCapture ▣ Command: □ adb shell screencap -p /sdcard/screen.png □ adb pull /sdcard/screen.png □ adb shell rm /sdcard/screen.png ▣ Other way □ adb shell screencap -p | sed 's/r$//' > screen.png □ adb shell screencap -p | perl -pe 's/x0Dx0A/x0A/g' > screen.png
  16. 16. ScreenRecord ▣ Command: □ adb shell screenrecord /sdcard/recording.mp4 □ adb pull /sdcard/recording.mp4 □ adb shell rm /sdcard/recording.mp4
  17. 17. Adb Key Event ▣ Power Button □ adb shell input keyevent 26 ▣ Unlock screen □ adb shell input keyevent 82 ▣ Volume down □ adb shell input keyevent 25 ▣ List of Keyevent □ http://developer.android.com/reference/android/view/KeyEv ent.html
  18. 18. Logcat - Logging ▣ Filter by tagname □ adb logcat -s TAG_NAME □ adb logcat -s TAG_NAME_1 TAG_NAME_2 ▣ Filter by priority □ adb logcat "*:PRIORITY"  V - Verbose (lowest priority)  D - Debug  I - Info  W - Warning  E - Error  F - Fatal  S - Silent (highest priority, on which nothing is ever printed)
  19. 19. Logcat - Logging ▣ Filter using grep □ adb logcat | grep "SEARCH_TERM" □ Example  adb logcat | grep "Exception" ▣ Clearing the logcat buffer □ adb logcat -c
  20. 20. Logcat - Buffers ▣ radio - adb command “” □ View the buffer that contains radio/telephony related messages. ▣ events □ View the buffer containing events-related messages. ▣ main □ View the main log buffer (default) Run Command “logcat -b <buffer>”
  21. 21. Shell Commands ▣ dumpstate □ Dumps state to a file. ▣ dmesg □ Prints kernel debugging messages to the screen ▣ start □ Starts an emulator/device instance. ▣ stop □ Stops execution of an emulator/device instance. ▣ restart □ restart an emulator/device instance.
  22. 22. Shell Commands ▣ top □ Prints all the running tasks on your device ▣ Service □ Help to communicate with phone services  service list  service check <SERVICE_NAME>  service call <SERVICE_NAME> CODE
  23. 23. Shell Commands - More ▣ More Commands □ adb shell ls /system/bin
  24. 24. AM - Activity Manager ▣ Start Activity □ am start <packageName/.ActivityClass> ▣ Start/Stop Service □ am startservice -n <packageName/.ServiceClass> □ am stopservice -n <packageName/.ServiceClass> ▣ Send broadcast □ am broadcast -a <action_name> ▣ Users □ am switch-user <USER_ID> □ am start-user <USER_ID> □ am stop-user <USER_ID> ▣ More Commands ▣ adb shell am
  25. 25. PM - Package Manager ▣ pm list packages ▣ pm list permission-groups ▣ pm list users ▣ pm install ▣ pm create-user ▣ pm remove-user USER_ID ▣ pm get-max-users ▣ More Commands ▣ adb shell pm
  26. 26. Dumpsys ▣ dumpsys □ will show all system data from the device ▣ you can filter it by adding □ dumpsys activity □ dumpsys batterystats □ dumpsys cpuinfo □ dumpsys wifi □ dumpsys meminfo □ dumpsys package ‘package’ ▣ More: □ adb shell dumpsys -l
  27. 27. Joke commands ▣ adb hell □ same as ”adb shell” except ”hell” color :) ▣ adb lolcat □ same as ”adb logcat”
  28. 28. Task #1 1. Open Settings Application a. main application 2. Open Settings In Inner Activity a. WifiSettings
  29. 29. Task #2 1. Get System Application to pc a. Dialer.apk
  30. 30. Task #3 1. Open my Application with intent and extra a. extra keys i. string ii. bool iii. float iv. string_array ▣ Download Apk □ https://goo.gl/IWTGle ▣ Code reference □ https://github.com/yossigruner/AdbSession
  31. 31. Task #4 1. enable the NFC 2. disable the NFC
  32. 32. Answers ▣ Task #1 □ adb shell am start -S com.android.settings/com.android.settings.Settings □ adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings ▣ Task #2 □ adb root □ adb remount □ adb pull /system/priv-app/Dialer/Dialer.apk ▣ Task #3 □ adb shell am start -n com.mike.adbsession/com.mike.adbsession.MainActivity --ez bool false --ef float 1.999 --es string hello --esa string_array hello,world ▣ Task #4 □ enable - service call nfc 6 □ disable - service call nfc 5
  33. 33. References ▣ https://community.woodwing.net/sites/default/files/A ndroid%20Debug%20Bridge%20%7C%20Android% 20Developers.pdf ▣ https://source.android.com/devices/tech/debug/dum psys.html
  34. 34. Thanks!Any questions? yossigruner@gmail.com
  • SinaWittig

    Jan. 27, 2021
  • RawezhFakhraden

    Nov. 27, 2019
  • Aishwarya06R

    Jan. 9, 2019
  • liuliufor

    Sep. 28, 2018
  • a7385057787

    Aug. 23, 2017
  • CarlosBarboza30

    Aug. 10, 2017
  • YeMaung7

    Jul. 5, 2017
  • krcheenu

    Jan. 31, 2017
  • temuraru

    Oct. 24, 2016
  • PritiKumari49

    Jul. 4, 2016
  • keitafukuda146

    Jun. 12, 2016
  • sherlockwu

    Jun. 7, 2016
  • reddypdl

    May. 13, 2016
  • IddanGivon

    Mar. 21, 2016
  • kfoutzopoulos

    Oct. 18, 2015
  • maayanzrihen3

    Aug. 6, 2015
  • guberm

    Aug. 6, 2015
  • orendayan1

    Aug. 5, 2015

Android ADB

Views

Total views

4,844

On Slideshare

0

From embeds

0

Number of embeds

40

Actions

Downloads

202

Shares

0

Comments

0

Likes

18

×