Skip to content

Instantly share code, notes, and snippets.

@chrisbanes
chrisbanes / bash_aliases
Created March 30, 2020 13:23
Shell function to set default JDK to Android Studio's bundled JDK
function set-studio-jdk() {
export JAVA_HOME=$1/Contents/jre/jdk/Contents/home/
}
@slinkydeveloper
slinkydeveloper / README.md
Last active February 4, 2018 15:43
My GSoC 2017 - Francesco Guardiani - Eclipse Vert.x - Router Factory for Design Driven Web API Development
@tadfisher
tadfisher / AutofillInterceptor.kt
Created August 17, 2017 20:13
AutofillKiller
import android.os.Build
import android.view.View
import io.github.inflationx.viewpump.InflateResult
import io.github.inflationx.viewpump.Interceptor
import javax.inject.Inject
class AutofillKillerInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): InflateResult {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
require 'cucumber'
require 'selenium-webdriver'
# require 'cukehub' # optional, but recommended. See cukehub.com for more details
caps = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { binary: "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary",
args: [ "--headless" ]})
Before do
@browser = Selenium::WebDriver.for :chrome, desired_capabilities: caps
end
@drewhannay
drewhannay / FinishingActivityTestRule.java
Last active June 21, 2017 18:25
Android Espresso Activity Clean Up
/**
* Copyright (C) 2017 Drew Hannay
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
@tasomaniac
tasomaniac / screenrecord.sh
Last active June 28, 2022 22:05 — forked from PaulKinlan/getdeviceart.sh
Screen Record for Android
#!/bin/sh
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
@TeresaP
TeresaP / merge-xml-coverage.py
Last active March 20, 2020 06:58 — forked from tgsoverly/merge-xml-coverage.py
Merge Cobertura XML's
import logging
import os
import re
import sys
import xml.etree.ElementTree as ET
from optparse import OptionParser
### This file came from the https://github.com/flow123d/flow123d repo they were nice enough to spend time to write this.
### It is copied here for other people to use on its own.
@lawrencelomax
lawrencelomax / DYLD_INSERT_LIBRARIES Simulator Kernel Protection.md
Last active May 10, 2018 16:36
deny-mmap for DYLD_INSERT_LIBRARIES on Simulator Process

It looks like the Simulator.app binary is now signed as of Xcode 7 as the following occurs in instruments-without-delay when using the build script:

./build.sh test <SIMULATOR-UDID>

The message that we get from the kernel is: 7/23/15 12:22:52.000 PM kernel[0]: AMFI: Simulator(pid 72600) - [deny-mmap] mapped file has no team identifier and is not a platform binary: /Users/lawrencelomax/src/instruments-without-delay/build/SimShim.dylib

This causes a crash:

/*
* This class is used for buttons that have a pressed state animation.
* Can't use default click() because espresso bug where click becomes long click, which causes
* animation, which causes tests to stall because ui thread is busy. :(
* https://code.google.com/p/android-test-kit/issues/detail?id=45
*/
public class CallOnClickAction implements ViewAction {
@Override
public Matcher<View> getConstraints() {
return allOf(isClickable(), isDisplayed());