Thursday, April 9, 2015

Find files and tar them

/note to myself

Finding files with most powerful utility find sending them to tarball
  find . -maxdepth 2 -type f -print0 | tar -czvf backup.tar.gz --null -T -  

It will:
  • deal with files with spaces, newlines, leading dashes, and other funniness
  • handle an unlimited number of files
  • won't repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files

chrome dev tools truncate text in console

Things can get long.
For example location.href.

To copy looong location.href to clipboard with chrome dev tools use 

copy(location.href)

Start Google Chrome on Android Emulator

Prepare Android emulator

  • Use Android emulator with enabled GPU - start emulator with -gpu on 
  • Use larger system and data partition - start emulator with -partition-size 1024


Get a binary of Chrome - I use apk from http://www.apkmirror.com/apk/google-inc/chrome/

adb install com.android.chrome...apk


For web test automation one can use appium bundled with chromedriver, as well as chromedriver solely.


Thursday, February 19, 2015

Android SDK and Maven project

Haven't found modern android.jar on mvnrepo (only some old from2012).

So to add android 19 to your maven project:


1st: Install android jars as dependencies to your local repo (~/.m2)

cd ${ANDROID_HOME}/platforms/android-19


$ mvn install:install-file -Dfile=android.jar \
  -DgroupId=com.google.android -DartifactId=android -Dversion=4.4.2

$ mvn install:install-file -Dfile=uiautomator.jar \
  -DgroupId=com.google.android -DartifactId=android-test \
  -Dversion=4.4.2 -Dpackaging=jar


2nd: Add dependencies to your pom.xml

<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>4.4.2</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android-test</artifactId>
    <version>4.4.2</version>
    <scope>test</scope>
</dependency>


Should be good to go!

Monday, August 25, 2014

Why libimobiledevice are good. or List all iDevices connected to a host.

a note to meself

for i in `idevice_id --list`;
do 
  ideviceinfo -u $i |grep "^SerialNumber\|^DeviceName"; 
done;