Wednesday, September 21, 2016

Xcode 8 libimobiledevice lockdownd

with Xcode 8 libimobiledevice s could stop working. just in case if you see something like:

    ERROR: Could not connect to lockdownd, error code -5

this should fix it (add your user to _usbmuxd group)

    sudo dseditgroup -o edit -a $USER -t user _usbmuxd



Friday, September 11, 2015

GPU-emulation for Android Emulator on a headless Linux

Eventually Google've released GPU emulation to public with new SDK 24.3.4

With GPU-EMULATION  it is possible to move your Android test farm to clouds like AWS without pay lots of money for instances with GPU.

Here is a how-to configure a headless GNU/Linux for Android with GPU emulation.

# install packages for android sdk
dpkg --add-architecture i386
apt-get update
apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386 lib32stdc++6 lib32z1 -y

# install Xorg (along with 32bit libs) for emulator to work with imaginary GPU
apt-get install xserver-xorg xserver-xorg-video-dummy x11-xserver-utils \
 x11vnc libgl1-mesa-dev libx11-6 libx11-dev libx11-6:i386 libx11-dev:i386 -y

# create config file /etc/X11/xorg.conf

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "dummy"
    VendorName     "Dummy Corporation"
    Option "NoDDC" "true"
    Option "IgnoreEDID" "true"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "NoLogo" "True"
    Option         "UseDisplayDevice" "none"
    SubSection     "Display"
        Virtual     1024 768
        Depth       24
    EndSubSection
EndSection

# start Xorg
Xorg :0


# get fresh SDK
wget http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz
.....

# do not forget about environment variables
JAVA_HOME=...

ANDROID_HOME=/usr/local/android/android-sdk-linux

LD_LIBRARY_PATH=${ANDROID_HOME}/tools/lib/gles_mesa:${ANDROID_HOME}/tools/lib/:${LD_LIBRARY_PATH}

PATH=${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}

export JAVA_HOME ANDROID_HOME PATH LD_LIBRARY_PATH

# after creating android virtual device, add to config.ini :
hw.gpu.enabled=true
hw.gpu.mode=mesa


# start emulator
DISPLAY=:0 emulator -avd a442 -no-boot-anim -noaudio -no-jni -gpu mesa

# see in logs
emulator: Initializing hardware OpenGLES emulation support
emulator: OpenGL Vendor=[Google (VMware, Inc.)]
emulator: OpenGL Renderer=[Android Emulator OpenGL ES Translator (Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits))]
emulator: OpenGL Version=[OpenGL ES 2.0 (3.0 Mesa 10.4.2 (git-))]

Ansible Rocks

Even when you don't want to create playbooks http://docs.ansible.com/ansible/intro_adhoc.html

Real help with farms of virtual appliances in OpenStack or AWS

Saturday, August 29, 2015

iOS 8 Safari screenshots with variable browser header height

Capturing shots when a browser has variable header height
In iOS 8 Safari comes with a feature when browser's header might be 65px or 41px (when address bar is hidden on scroll, aka minimal-ui) .


For example to capture pages on iPad 2 one could use AShot utility with a strategy that can detect current height of browser's header.

int minHeader = 41;
int maxHeader = 65;
int minViewPortHeight = 960; // Height of viewport when address bar shown
HeaderDetectionStrategy strategy =
    new VariableHeaderDetectionStrategy(minHeader, maxHeader, minViewPortHeight);
new AShot()
  .shootingStrategy(new ViewportPastingStrategy(strategy))
  .takeScreenshot(webDriver);
When in JavaScript to guess the height of browser's header - whether address bar is shown, window.innerHeight property could be used.

Wednesday, July 22, 2015

Android remote control - Smartphone Test Farm

Really great piece of software for a QA engineer and even for a QA team!

Allows to control and manage real Android smartphone devices from your browser.