Skip to content

Instantly share code, notes, and snippets.

@d4vidi
d4vidi / emu-launch-2.sh
Last active September 2, 2021 14:36
Android CI Blog: Emulator launch 2/3
# Enable on-screen indicators of taps, swipes and scroll actions.
./platform-tools/adb shell settings put system show_touches 1
./platform-tools/adb shell settings put system pointer_location 1
# (*OPTIONAL for Detox users*) Restart adb in root mode (i.e. allow root access to the emulator).
# Detox may need this in order to be able to install apps on the emulator in a way more
# stable than using "adb install path/to/app.apk".
# If you wish to use Detox and avoid that nevertheless, apply the "--force-adb-install" argument
# to your "detox test" commands.
# See https://github.com/wix/Detox/blob/master/docs/APIRef.DetoxCLI.md#test for more info.
@d4vidi
d4vidi / install-test-butler.sh
Last active September 2, 2021 08:35
Android CI Blog: test butler (emu launch)
# Download test butler
curl -f -o ~/test-butler-2.2.1.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk
# Install test butler
./platform-tools/adb install ~/test-butler-2.2.1.apk
# Launch the test butler background service!!!
./platform-tools/adb shell am startservice com.linkedin.android.testbutler/com.linkedin.android.testbutler.ButlerService
# Check that the service is indeed running... Expected output is:
@d4vidi
d4vidi / DetoxTest.java
Last active September 2, 2021 09:05
Android CI Blog: assert test butler
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DetoxTest {
@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
@Test
public void runDetoxTests() {
// This is optional - in case you've decided to integrate TestButler
// See https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md#8-test-butler-support-optional
@d4vidi
d4vidi / adbjam-genycloud.py
Created January 10, 2022 16:57
adbjam-genycloud
#!/usr/bin/env python3
import os
import sys
import signal
import datetime
def log(text):
now=datetime.datetime.now().strftime("%H:%M:%S.%f")
print("@"+now+" <"+ANDROID_SERIAL+"> " + text)