December 2022

Branching

Branching, in revision control and software configuration management, is the duplication of an object under revision control (such as a source code file, or a directory tree) so that modifications can happen in parallel along both branches.

The originating branch is sometimes called the parent branch, the upstream branch (or simply upstream, especially if the branches are maintained by different organisations or individuals), or the backing stream. Child branches are branches that have a parent; a branch without a parent is referred to as the trunk or the mainline.[1]

In some distributed revision control systems, such as Darcs, there is no distinction made between repositories and branches; in these systems, fetching a copy of a repository is equivalent to branching.

Branching also generally implies the ability to later merge or integrate changes back onto the parent branch. Often the changes are merged back to the trunk, even if this is not the parent branch. A branch not intended to be merged (e.g. because it has been relicensed under an incompatible license by a third party, or it attempts to serve a different purpose) is usually called a fork.

Setting up .gitignore to ignore unwanted contents at cloud

.gitignore file should be at root of the project with following pattern,

  • Add the file name like project.settings to ignore it
  • If we need to ignore multiple files with same extensions we can use *.settings
  • If we need to ignore multiple files in a directory with same extensions we can use /src/*.xml
  • If we needs to ignore a directory with its all contents, we can use /bin/*

my .gitignore:

/bin/*
/gen/*
/results/*
*.class
*.log
*.png
.project
.classpath
.hg
.settings

Appium Android – How to handle ‘Install via USB’ pop ups on Xiaomi devices

During Appium Android automation on Xiaomi devices there comes ‘Install Via USB’ popup every time execution is triggered. It can be handled using following steps,

  1. Signup with MI account on device if not already signed up
  2. Settings Screen > Additional Settings > Developer options > Turn off ‘Miui Optimizations’ option > Restart device
  3. Settings Screen > Security > Permissions > Icon at top right corner > Turn On “Install via USB” option
  4. Settings Screen > Additional Settings > Developer options > Turn On/Off “USB Debugging” > Turn On “Install vis USB” option

Trigger execution and pop-up will not come again.

Communicate and Debug apps on iOS Real Devices

Communicating iOS apps on real devices was never a straight thing earlier. In this article we’ll collect available open source tools to communicate and debug with app on iOS Real Devices.

ios-deploy

Install and debug iOS apps from the command line. Designed to work on un-jailbroken devices. It can be installed from brew or npm and come up with following list of useful options,

Usage: ios-deploy [OPTION]...
-d, --debug launch the app in lldb after installation
-i, --id <device_id> the id of the device to connect to
-c, --detect only detect if the device is connected
-b, --bundle <bundle.app> the path to the app bundle to be installed
-a, --args <args> command line arguments to pass to the app when launching it
-s, --envs <envs> environment variables, space separated key-value pairs, to pass to the app when launching it
-t, --timeout <timeout> number of seconds to wait for a device to be connected
-u, --unbuffered don't buffer stdout
-n, --nostart do not start the app when debugging
-N, --nolldb start debugserver only. do not run lldb. Can not be used with args or envs options
-I, --noninteractive start in non interactive mode (quit when app crashes or exits)
-L, --justlaunch just launch the app and exit lldb
-v, --verbose enable verbose output
-m, --noinstall directly start debugging without app install (-d not required)
-A, --app_deltas incremental install. must specify a directory to store app deltas to determine what needs to be installed
-p, --port <number> port used for device, default: dynamic
-r, --uninstall uninstall the app before install (do not use with -m; app cache and data are cleared) 
-9, --uninstall_only uninstall the app ONLY. Use only with -1 <bundle_id> 
-1, --bundle_id <bundle id> specify bundle id for list and upload
-l, --list[=<dir>] list all app files or the specified directory
-o, --upload <file> upload file
-w, --download[=<path>] download app tree or the specified file/directory
-2, --to <target pathname> use together with up/download file/tree. specify target
-D, --mkdir <dir> make directory on device
-R, --rm <path> remove file or directory on device (directories must be empty)
-X, --rmtree <path> remove directory and all contained files recursively on device
-V, --version print the executable version 
-e, --exists check if the app with given bundle_id is installed or not 
-B, --list_bundle_id list bundle_id 
-W, --no-wifi ignore wifi devices
-C, --get_battery_level get battery current capacity 
-O, --output <file> write stdout to this file
-E, --error_output <file> write stderr to this file
--detect_deadlocks <sec> start printing backtraces for all threads periodically after specific amount of seconds
-f, --file_system specify file system for mkdir / list / upload / download / rm
-k, --key keys for the properties of the bundle. Joined by ',' and used only with -B <list_bundle_id> and -j <json>
-F, --non-recursively specify non-recursively walk directory
-j, --json format output as JSON

Repo link – https://github.com/ios-control/ios-deploy

libimobiledevice

A cross-platform protocol library to access iOS devices, it is one the oldest best available tool which comes up with a bunch of libraries and command-line utilities to control iOS devices.

Some popular libraries are,

idevicerestore Restore/upgrade firmware of iOS devices

ideviceinstaller Manage apps of iOS devices

libideviceactivation A library to handle the activation process of iOS devices

libusbmuxd A client library to multiplex connections from and to iOS devices

Repo link – https://github.com/libimobiledevice

idb – iOS Development Bridge

The “iOS Development Bridge” or idb, is a command line interface for automating iOS Simulators and Devices by Facebook.

idb is made up of 2 major components, each of which needs to be installed separately.

idb companion

Each target (simulator/device) will have a companion process attached allowing idb to communicate remotely.

The idb companion can be installed via brew or built from source

brew tap facebook/fb

brew install idb-companion

Note: Instructions on how to install brew can be found here

idb client

A cli tool and python client is provided to interact with idb.

It can be installed via pip:

pip3.6 install fb-idb

Repo Link – https://github.com/facebook/idb

Verification Vs Validation

Verification
Verification does not involve code execution, it includes checking of documents, design, code and program.

While testing does involve checking whether the system meets specified requirements,

Checks if the software has been built according to the requirements or not. Confirmation by examination and through provision of objective evidence that specified requirements have been fulfilled.

Validation
Validation involves code execution. It includes testing and validation of the actual product. if the software has been built according to the requirements or not.

Checking whether the system will meet user and other stakeholder needs in its operational environment(s).

Confirmation by examination and through provision of objective evidence that the requirements for a specific intended use or application have been fulfilled.