Skip to content

Instantly share code, notes, and snippets.

### proguard-rules.pro ###
# Standard rules for my App:
-keep class this.and.That { *; }
-dontwarn com.on.**
# Some more rules so that my instrumentation tests could run:
-keep class com.thirdparty.Z { *; }
android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
// Custom build type, just for running instrumentation tests!!!
instrum {
// "Inherit" from 'release' buildType
### proguard-rules.pro ###
-keep class this.and.That { *; }
-dontwarn com.on.**
#!/bin/bash
echo ""
echo "[Waiting for launcher to start]"
LAUNCHER_READY=
while [[ -z ${LAUNCHER_READY} ]]; do
UI_FOCUS=`adb shell dumpsys window windows 2>/dev/null | grep -i mCurrentFocus`
echo "(DEBUG) Current focus: ${UI_FOCUS}"
case $UI_FOCUS in
@d4vidi
d4vidi / device.log
Last active March 3, 2020 09:18
Detox #1708: Sample 2 - failure on Detox CI running on Jenkins
(https://jenkins-oss.wixpress.com/job/detox-android-61-4-pr/236/consoleFull)
Detox log:
14:38:48 FAIL 03.actions.test.js (210.947s)
14:38:48 Actions
14:38:48 ✓ should tap on an element (3662ms)
14:38:48 ✓ should long press on an element (4754ms)
14:38:48 ✓ should long press with duration on an element (4990ms)
14:38:48 ✓ should multi tap on an element (6332ms)
alias ll='exa -alF'
alias lt='exa --tree'
alias lt2='exa --tree --level=2'
alias lt3='exa --tree --level=3'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# Git and Github
@d4vidi
d4vidi / avd-setup.sh
Last active March 6, 2023 19:54
Android CI Blog: avd setup.
# Install the emulator tool
./tools/bin/sdkmanager --install emulator
# Install an AOSP image that would later be used as the AVD's OS
./tools/bin/sdkmanager --install "system-images;android-29;default;x86_64"
# Accept all licenses...
./tools/bin/sdkmanager --licenses
# To do that automatically in a script, try this:
yes | ./tools/bin/sdkmanager --licenses
@d4vidi
d4vidi / avd-config_ini.sh
Last active September 1, 2021 18:43
Android CI Blog: config.ini
# Attributes in .ini file:
# hw.lcd.density=440
# hw.lcd.height=2280
# hw.lcd.width=1080
# OR, it you need an automated script - they can be simply appended to the existing file:
echo "hw.lcd.density=440" > config.ini
echo "hw.lcd.height=2280" > config.ini
echo "hw.lcd.width=1080" > config.ini
@d4vidi
d4vidi / emu-launch-1.sh
Last active October 17, 2021 06:55
Android CI Blog: Emulator launch 1/3
# Launch the emulator!
./emulator/emulator -verbose -no-boot-anim @Pixel_4_API_29 &
# (or, if running on a headless machine)
./emulator/emulator -verbose -no-boot-anim -no-audio -no-window -gpu swiftshader_indirect @Pixel_4_API_29 &
# Wait for the emulator to boot up completely.
# This script is actually a bit naive. There are various suggestions out there
# as to make this more robust. One alternative is to utilize the "adb wait-for-device" command.
booted=0
while [ "$booted" != "1" ]
@d4vidi
d4vidi / emu-launch-3.sh
Created September 1, 2021 18:59
Android CI Blog: Emulator launch 3/3
# Gracefully shut the emulator down
killall qemu-system-x86_64
# (or, if running headless)
killall qemu-system-x86_64-headless
### Side-note: If you wish to brutally shut the emulator down without having
### anything saved - for whatever reason, you can kill using the SIGKILL signal:
killall -9 qemu-system-x86_64