Skip to content

To-Do List #2

@thyrlian

Description

@thyrlian
  • adb logcat
  • adb shell am broadcast
  • adb shell screenrecord [path_on_your_device]/[filename].mp4 # allow -bit-rate param # support convert to webm???

http://developer.android.com/tools/help/shell.html#screenrecord
adb shell screenrecord /sdcard/demo.mp4
adb pull /sdcard/demo.mp4

  • cpdir
def cpdir(remote_dir, local_dir)
  remote_dir = File.join(remote_dir, "")
  local_dir = File.join(local_dir, "")
  files = `adb shell ls #{remote_dir}`.split("\r\n")
  files.each do |f|
    `adb pull #{remote_dir}#{f} #{local_dir}/#{f};`
  end
end

Random Crap

==================================================

Default 5xx

choose a device -> then routing becomes /device/xxx
session value use selected device
(but how to handle error when device is removed/unplugged?)

reset button for chose package

adb shell screenrecord /sdcard/demo.mp4
adb pull /sdcard/demo.mp4

adb -s 192.168.56.102:5555 install app.apk

http://stackoverflow.com/questions/7789826/adb-shell-input-events
https://github.com/senzhk/ADBKeyBoard

usage: input ...
input text
input keyevent
input [touchscreen|touchpad|touchnavigation] tap
input [touchscreen|touchpad|touchnavigation] swipe [duration(ms)]
input trackball press
input trackball roll

Account management
http://www.slideshare.net/dpreussler/abgeschottete-realitt-mobile-testing-days-2014-berlin

disable select button if no radio (device) is checked
http://stackoverflow.com/questions/3196136/disable-browse-button-if-the-radio-button-isnt-selected

adb shell dumpsys meminfo <package.name>
dumpsys meminfo
dumpsys cpuinfo
dumpsys account
dumpsys activity
dumpsys window
dumpsys wifi

http://engineering.meetme.com/2014/04/android-debug-bridge-adb-command-scripting/

main.haml

  • specify package name
  • choose device (no need if only one; error message if none; give options if more)
  • disable actions (clear / uninstall) when no valid package / device is chosen

Knowledge Base
-s - directs command to the device or emulator with the given
serial number or qualifier. Overrides ANDROID_SERIAL
environment variable.
adb devices -l # human readable form
adb shell 'pm list packages -f' | sed -e 's/.=//' | grep 'ebay'
cat /data/system/packages.list | sed -e 's/.
///' | grep 'ebay'
adb shell screencap -p | ruby -EBINARY -pe '$_.gsub!(/\r\n/, "\n")' > ~/Desktop/screenshot.png
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Desktop/screenshot.png

adb shell screenrecord /sdcard/movie.mp4
(Press Ctrl-C to stop)
adb pull /sdcard/movie.mp4
http://developer.android.com/tools/help/adb.html#screenrecord
http://stackoverflow.com/questions/5382212/capture-video-of-androids-screen

ddmlib: Library providing APIs to talk to Android devices
http://mvnrepository.com/artifact/com.android.tools.ddms/ddmlib/23.1.0

adb backup app
adb wifi

adb uninstall com.xxx.abc
1> x.log
2> x.log
echo $?

adb -s BH902VWU16 shell 'which sh; echo $?'
/system/bin/sh: which: not found
127

adb shell sqlite3
/data/data/com.android.providers.telephony/databases/telephony.db
"update carriers set proxy=''xxx', port='xx' where id=xxx "

Unit Tests:

list_devices

  • daemon not running. starting it now on port 5037 *
  • daemon started successfully *

List of devices attached
BH902VWU16 device
192.168.56.101:5555 device

Style:
.clickable {
cursor: pointer;
}

http://www.codeceo.com/article/android-adb-shell.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions