Skip to content

Instantly share code, notes, and snippets.

View jiasheng-li089's full-sized avatar

Jiasheng Li jiasheng-li089

  • 17:03 (UTC +13:00)
View GitHub Profile
@jiasheng-li089
jiasheng-li089 / andro_info.sh
Created July 22, 2020 02:43 — forked from konfou/andro_info.sh
Android Device Specifications
#! /bin/bash
if ! type adb; then
echo "adb not found"
echo "check PATH"
else
echo "============================"
echo "Android Device Specificatios"
echo "============================"
adb wait-\for-device
echo "> Manufacturer"
@jiasheng-li089
jiasheng-li089 / detect_module_script.groovy
Last active August 29, 2019 08:31 — forked from moksamedia/gist:5475917
Gradle: to automatically discover subprojects and include them in your root project, put this in your settings.gradle file
/*
* Here we iterate over the directories found in the root directory of the
* main project, and if the subdirectory contains a build.gradle file, it
* is added to the main project as a subproject.
*/
Closure discoverSubprojects = {
def list = []
rootDir.eachDir(){ dir ->
dir.eachFileMatch({it == 'build.gradle'}, { list += [dir.name] })
@jiasheng-li089
jiasheng-li089 / Gradle Android Fat Jar Library
Last active March 26, 2020 02:49 — forked from kesco/Gradle Android Fat Jar Library
Android gradle script snippets
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
return; // Skip debug builds.
}
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
//Include Java classes
task.from variant.javaCompile.destinationDir
//Include dependent jars with some exceptions
@jiasheng-li089
jiasheng-li089 / move_sample.py
Last active July 1, 2019 02:08 — forked from sjp38/gist:6202539
Monkeyrunner Code Snippets
#!/usr/bin/env monkeyrunner
import time
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
# Touch down screen
device.touch(100, 500, MonkeyDevice.DOWN)