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.
the tool not only for developers I
ANDROID
ANDROID FORK
EMULATOR
Małgorzata Bugajska
q install and debug apps
q copy files into and from the device
q reboot the device
q view device log
q access a Unix ...
DEAMON
SERVER
CLIENT
• sends commands
• runs on a development
machine
• runs commands on a device
• runs as a background
p...
AndroidSDK
Małgorzata Bugajska
Małgorzata Bugajska
1. Settings
2. About phone
3. Build number (x7)
4. Settings / Developer options
5. USB debugging
Małgorzata Bugajska
adb [<target>] <command>
adb devices
List of devices attached
B0870706441501LE device
-s <SerialNumber> à target instance...
adb push [-p] <locale> <remote>
adb pull [-p] [-a] <remote> [<locale>]
-p à display the transfer progress
-a à copy time...
adb reboot
adb wait-for-device
adb root
adb reboot bootloader
adb fastboot <command>
Małgorzata Bugajska
adb shell
shell@saturn:/ $ cd /sdcard/trojqa/
shell@saturn:/sdcard/trojqa $ ls
foto1.png
adb shell ls /sdcard/trojqa/
foto...
Ø ps – (process status) e.g. to kill a process
Ø am – (activity manager), e.g. to open activity
Ø input - to send text ...
adb shell ps | grep com.amazon.camera
amz_u0a4 27680 534 1687432 71956 ffffffff 00000000 S com.amazon.camera
PID on the 9t...
adb logcat | grep cmp
I/ActivityManager( 1648): START u0 {act=android.intent.action.MAIN
cat=[android.intent.category.LAUN...
adb shell input text <text>
%s is a space
3 à "KEYCODE_HOME"
4 à "KEYCODE_BACK"
23 à "KEYCODE_DPAD_CENTER"
66 à "KEYCO...
adb shell getprop ro.build.version.release
5.1.1
adb shell getprop ro.product.cpu.abi
armeabi-v7a
system version
Is it ARM...
https://busybox.net
Download binary file:
q The busybox-i686 version should run on
both 32-bit and 64-bit x86 PCs
q The ...
# push binary file to the device
adb push busybox /system/bin/busybox
# change file mode
adb shell chmod 777 /system/bin/b...
adb install [<option>] <path>
-r à reinstall existing app, keeping its data
-s à install on the internal system memory
-...
adb shell pm list packages [<option>]
-f à absolute path to the installed package
-d à only disabled
-e à only enabled
...
adb shell screencap <file_name>.png
adb shell screencap /sdcard/photo.png && adb pull /sdcard/photo.png .
1750 KB/s (21694...
adb shell screenrecord <file_name>.mp4
screenrecord is always saved on the device
Ctrl+C to stop recording
Małgorzata Buga...
§ Android Studio
https://developer.android.com/studio/index.html
§ About Android for developers and not only for them J...
Małgorzata Bugajska
Upcoming SlideShare
Loading in …5
×

Android Debug Bridge – narzędzie nie tylko dla deweloperów

168 views

Published on

by Gosia Bugajska
Z najnowszych badań wynika, że w minionym kwartale udział systemu operacyjnego Android w światowym rynku smartfonów osiągnął ponad 87%. Oznacza to, że jeśli jeszcze nie testujesz na Androidzie, to jest duże prawdopodobieństwo, że na swojej testerskiej drodze spotkasz zielonego ludzika z Doliny Krzemowej. Narzędziem, po które warto wówczas sięgnąć jest ADB (Android Debug Bridge).
O narzędziu, jego możliwościach oraz o tym, jak ja wykorzystuję ADB w codziennej pracy opowie w swojej prezentacji.

Prezentację poprowadzi Gosia Bugajska, która testowaniem oprogramowania zajmuje się od 5 lat. Swoją przygodę w IT rozpoczęła w firmie tworzącej system informatyczny dla towarzystw ubezpieczeniowych.

Od niespełna roku stawia pierwsze kroki w automatyzacji testów jako QAE w firmie Ivona Software, będącej częścią korporacji Amazon. Ivona Software wytwarza światowej klasy syntezator mowy oparty na technologii Text-To-Speech.

Published in: Government & Nonprofit
  • Be the first to comment

  • Be the first to like this

Android Debug Bridge – narzędzie nie tylko dla deweloperów

  1. 1. the tool not only for developers I
  2. 2. ANDROID ANDROID FORK EMULATOR Małgorzata Bugajska
  3. 3. q install and debug apps q copy files into and from the device q reboot the device q view device log q access a Unix shell on the device q and many many more Małgorzata Bugajska
  4. 4. DEAMON SERVER CLIENT • sends commands • runs on a development machine • runs commands on a device • runs as a background process on a device • manages communication between the client and the deamon • runs as a background process on the development machine Małgorzata Bugajska
  5. 5. AndroidSDK Małgorzata Bugajska
  6. 6. Małgorzata Bugajska
  7. 7. 1. Settings 2. About phone 3. Build number (x7) 4. Settings / Developer options 5. USB debugging Małgorzata Bugajska
  8. 8. adb [<target>] <command> adb devices List of devices attached B0870706441501LE device -s <SerialNumber> à target instance -d à attached usb device -e à emulator targets Małgorzata Bugajska
  9. 9. adb push [-p] <locale> <remote> adb pull [-p] [-a] <remote> [<locale>] -p à display the transfer progress -a à copy timestamp and mode locale à path to the local file remote à localization on the device Małgorzata Bugajska
  10. 10. adb reboot adb wait-for-device adb root adb reboot bootloader adb fastboot <command> Małgorzata Bugajska
  11. 11. adb shell shell@saturn:/ $ cd /sdcard/trojqa/ shell@saturn:/sdcard/trojqa $ ls foto1.png adb shell ls /sdcard/trojqa/ foto1.png cd mkdir rm cp mv touch echo Ctrl+D to exit shell Małgorzata Bugajska
  12. 12. Ø ps – (process status) e.g. to kill a process Ø am – (activity manager), e.g. to open activity Ø input - to send text or keyevent to the device Ø getprop – to get properies Ø pm – (package manager), e.g. to get list of installed packages Ø dumpsys – to get status of system service adb shell <shell command> /system/bin/ to get all shell commands Małgorzata Bugajska
  13. 13. adb shell ps | grep com.amazon.camera amz_u0a4 27680 534 1687432 71956 ffffffff 00000000 S com.amazon.camera PID on the 9th place adb shell kill 27680 root is needed Małgorzata Bugajska
  14. 14. adb logcat | grep cmp I/ActivityManager( 1648): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.amazon.camera/.AmazonCameraActivity} from uid 32071 on display 0 adb shell am start -n com.amazon.camera/.AmazonCameraActivity Starting: Intent { cmp=com.amazon.camera/.AmazonCameraActivity } cmp is a component Małgorzata Bugajska
  15. 15. adb shell input text <text> %s is a space 3 à "KEYCODE_HOME" 4 à "KEYCODE_BACK" 23 à "KEYCODE_DPAD_CENTER" 66 à "KEYCODE_ENTER" adb shell input keyevent <keyevent> Małgorzata Bugajska
  16. 16. adb shell getprop ro.build.version.release 5.1.1 adb shell getprop ro.product.cpu.abi armeabi-v7a system version Is it ARM or Intel x86? Małgorzata Bugajska
  17. 17. https://busybox.net Download binary file: q The busybox-i686 version should run on both 32-bit and 64-bit x86 PCs q The armv4tl version is the most generic arm version (for smartphones), so those are probably good starting points. Małgorzata Bugajska
  18. 18. # push binary file to the device adb push busybox /system/bin/busybox # change file mode adb shell chmod 777 /system/bin/busybox # create symlinks to the command, e.g. adb shell ln –s /system/bin/busybox /system/bin/vi adb shell ln –s /system/bin/busybox /system/bin/md5sum # or adb shell shell@saturn:/ $ cd system/bin shell@saturn:/system/bin $ busybox --install root is needed Małgorzata Bugajska
  19. 19. adb install [<option>] <path> -r à reinstall existing app, keeping its data -s à install on the internal system memory -f à install on the shared mass storage adb uninstall [-k] <package_name> -k à keep the data and cash directories around Małgorzata Bugajska
  20. 20. adb shell pm list packages [<option>] -f à absolute path to the installed package -d à only disabled -e à only enabled -s à only system packages -3 à only 3rd party packages adb shell dumpsys package <package_name> Małgorzata Bugajska
  21. 21. adb shell screencap <file_name>.png adb shell screencap /sdcard/photo.png && adb pull /sdcard/photo.png . 1750 KB/s (21694 bytes in 0.012s) screencap is always saved on the device Małgorzata Bugajska
  22. 22. adb shell screenrecord <file_name>.mp4 screenrecord is always saved on the device Ctrl+C to stop recording Małgorzata Bugajska
  23. 23. § Android Studio https://developer.android.com/studio/index.html § About Android for developers and not only for them J https://developer.android.com § Busybox https://busybox.net Małgorzata Bugajska
  24. 24. Małgorzata Bugajska

×