SlideShare una empresa de Scribd logo
1 de 34
Android
ADB
Hello!I am Yossi Gruner
Agenda
▣ what is adb
▣ adb commands
▣ adb scripts
▣ adb files
▣ adb over WiFi
▣ screen capture/record
▣ logcat
▣ shell command
□ am
□ pm
□ dumpsys
□ more…
What is ADB
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.
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
How it connect
How it connect
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
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>
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
Adb - Files
▣ Copy file to device
□ adb push <local> <remote>
▣ Copy file from device
□ adb pull <remote> <local>
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
BugReport
▣ Command
□ adb shell bugreport > bugreport.txt
□ java -jar chkbugreport.jar bugreport.txt
▣ JAR download
□ https://github.com/sonyxperiadev/ChkBugReport/download
s
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
ScreenRecord
▣ Command:
□ adb shell screenrecord /sdcard/recording.mp4
□ adb pull /sdcard/recording.mp4
□ adb shell rm /sdcard/recording.mp4
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
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)
Logcat - Logging
▣ Filter using grep
□ adb logcat | grep "SEARCH_TERM"
□ Example
 adb logcat | grep "Exception"
▣ Clearing the logcat buffer
□ adb logcat -c
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>”
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.
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
Shell Commands - More
▣ More Commands
□ adb shell ls /system/bin
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
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
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
Joke commands
▣ adb hell
□ same as ”adb shell” except ”hell” color :)
▣ adb lolcat
□ same as ”adb logcat”
Task #1
1. Open Settings Application
a. main application
2. Open Settings In Inner Activity
a. WifiSettings
Task #2
1. Get System Application to pc
a. Dialer.apk
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
Task #4
1. enable the NFC
2. disable the NFC
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
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
Thanks!Any questions?
yossigruner@gmail.com

Más contenido relacionado

La actualidad más candente

Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android StudioSuyash Srijan
 
ELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet ConnectivityELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet ConnectivityBenjamin Zores
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShellDale Lane
 
Android internals By Rajesh Khetan
Android internals By Rajesh KhetanAndroid internals By Rajesh Khetan
Android internals By Rajesh KhetanRajesh Khetan
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development pptGautam Kumar
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 

La actualidad más candente (20)

Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
 
ELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet ConnectivityELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Android internals By Rajesh Khetan
Android internals By Rajesh KhetanAndroid internals By Rajesh Khetan
Android internals By Rajesh Khetan
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
Android ppt
Android ppt Android ppt
Android ppt
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 

Destacado

Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging SystemWilliam Lee
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
android content providers
android content providersandroid content providers
android content providersDeepa Rani
 
Android content providers
Android content providersAndroid content providers
Android content providersKurt Mbanje
 
Android contentprovider
Android contentproviderAndroid contentprovider
Android contentproviderKrazy Koder
 
Content providers in Android
Content providers in AndroidContent providers in Android
Content providers in AndroidAlexey Ustenko
 
Controlling and monitoring external embedded device using android frameworks ...
Controlling and monitoring external embedded device using android frameworks ...Controlling and monitoring external embedded device using android frameworks ...
Controlling and monitoring external embedded device using android frameworks ...Dhruvilkumar patel
 
Android Overview
Android OverviewAndroid Overview
Android Overviewatomi
 
Android Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADKAndroid Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADKRajesh Sola
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIAhsanul Karim
 
Mobile Device Management
Mobile Device ManagementMobile Device Management
Mobile Device ManagementJohn Rhoton
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_androidPRITI TELMORE
 
Leveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolLeveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolGary Bisson
 
Android Overview
Android OverviewAndroid Overview
Android OverviewRaju Kadam
 

Destacado (20)

Android Debug
Android DebugAndroid Debug
Android Debug
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
android content providers
android content providersandroid content providers
android content providers
 
Android content providers
Android content providersAndroid content providers
Android content providers
 
Android contentprovider
Android contentproviderAndroid contentprovider
Android contentprovider
 
Content providers in Android
Content providers in AndroidContent providers in Android
Content providers in Android
 
Controlling and monitoring external embedded device using android frameworks ...
Controlling and monitoring external embedded device using android frameworks ...Controlling and monitoring external embedded device using android frameworks ...
Controlling and monitoring external embedded device using android frameworks ...
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
Android Development Tools
Android Development ToolsAndroid Development Tools
Android Development Tools
 
Android Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADKAndroid Open Accessory Protocol - Turn Your Linux machine as ADK
Android Open Accessory Protocol - Turn Your Linux machine as ADK
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts API
 
Mobile Device Management
Mobile Device ManagementMobile Device Management
Mobile Device Management
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
Leveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolLeveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory Protocol
 
Gradle
GradleGradle
Gradle
 
Gradle
GradleGradle
Gradle
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 

Similar a Android - ADB

Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testersMaksim Kovalev
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Introduction of unit test on android kernel
Introduction of unit test on android kernelIntroduction of unit test on android kernel
Introduction of unit test on android kernelJohnson Chou
 
Interacting with your app through the command line
Interacting with your app through the command lineInteracting with your app through the command line
Interacting with your app through the command lineRoman Mazur
 
Delivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and DockerDelivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and DockerJorrit Salverda
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Sarath C
 
OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...
OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...
OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...Paris Open Source Summit
 
Oracle goldengate and RAC12c
Oracle goldengate and RAC12cOracle goldengate and RAC12c
Oracle goldengate and RAC12cSiraj Ahmed
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android EmulatorSamael Wang
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDocker, Inc.
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with GanetiOSCON Byrum
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
Adrian Mouat - Docker Tips and Tricks
 Adrian Mouat - Docker Tips and Tricks Adrian Mouat - Docker Tips and Tricks
Adrian Mouat - Docker Tips and TricksKevin Cross
 

Similar a Android - ADB (20)

Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testers
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Adb instructions
Adb instructionsAdb instructions
Adb instructions
 
Introduction of unit test on android kernel
Introduction of unit test on android kernelIntroduction of unit test on android kernel
Introduction of unit test on android kernel
 
Interacting with your app through the command line
Interacting with your app through the command lineInteracting with your app through the command line
Interacting with your app through the command line
 
Android in ubuntu
Android in ubuntuAndroid in ubuntu
Android in ubuntu
 
Delivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and DockerDelivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and Docker
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?
 
Greach 2016 dockerize your grails
Greach 2016   dockerize your grailsGreach 2016   dockerize your grails
Greach 2016 dockerize your grails
 
OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...
OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...
OWF12/PAUG Conf Days Android tools for developpeurs, paul marois, design and ...
 
Oracle goldengate and RAC12c
Oracle goldengate and RAC12cOracle goldengate and RAC12c
Oracle goldengate and RAC12c
 
CI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOWCI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOW
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
FreeBSD: Dev to Prod
FreeBSD: Dev to ProdFreeBSD: Dev to Prod
FreeBSD: Dev to Prod
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with Ganeti
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Adrian Mouat - Docker Tips and Tricks
 Adrian Mouat - Docker Tips and Tricks Adrian Mouat - Docker Tips and Tricks
Adrian Mouat - Docker Tips and Tricks
 

Último

BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfCWS Technology
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Servicenishacall1
 

Último (6)

BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 

Android - ADB

  • 3. Agenda ▣ what is adb ▣ adb commands ▣ adb scripts ▣ adb files ▣ adb over WiFi ▣ screen capture/record ▣ logcat ▣ shell command □ am □ pm □ dumpsys □ more…
  • 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. 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
  • 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. 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. 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. Adb - Files ▣ Copy file to device □ adb push <local> <remote> ▣ Copy file from device □ adb pull <remote> <local>
  • 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. BugReport ▣ Command □ adb shell bugreport > bugreport.txt □ java -jar chkbugreport.jar bugreport.txt ▣ JAR download □ https://github.com/sonyxperiadev/ChkBugReport/download s
  • 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. ScreenRecord ▣ Command: □ adb shell screenrecord /sdcard/recording.mp4 □ adb pull /sdcard/recording.mp4 □ adb shell rm /sdcard/recording.mp4
  • 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. 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. Logcat - Logging ▣ Filter using grep □ adb logcat | grep "SEARCH_TERM" □ Example  adb logcat | grep "Exception" ▣ Clearing the logcat buffer □ adb logcat -c
  • 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. 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. 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. Shell Commands - More ▣ More Commands □ adb shell ls /system/bin
  • 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. 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. 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. Joke commands ▣ adb hell □ same as ”adb shell” except ”hell” color :) ▣ adb lolcat □ same as ”adb logcat”
  • 28. Task #1 1. Open Settings Application a. main application 2. Open Settings In Inner Activity a. WifiSettings
  • 29. Task #2 1. Get System Application to pc a. Dialer.apk
  • 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. Task #4 1. enable the NFC 2. disable the NFC
  • 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

Notas del editor

  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
  2. adb root adb remount adb pull /system/priv-app/Dialer/Dialer.apk
  3. open application adb shell am start -n com.mike.adbsession/com.mike.adbsession.MainActivity extra: 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
  4. # Enable NFC service call nfc 6 # Disable NFC service call nfc 5