Skip to content

Instantly share code, notes, and snippets.

View mikehardy's full-sized avatar

Mike Hardy mikehardy

View GitHub Profile
@mikehardy
mikehardy / start_all_emulators.sh
Last active August 31, 2018 18:49
Android emulator fleet management - startup
#!/bin/bash
for AVD in `emulator -list-avds`; do
echo -n Found $AVD...
SDCARD="/tmp/$AVD-sdcard.img"
NORMAL_ARGS="-no-boot-anim -sdcard $SDCARD"
EXTRA_ARGS=""
case "$AVD" in
*OLD*)
@mikehardy
mikehardy / stop_all_emulators.sh
Created August 31, 2018 18:50
Android emulator fleet management - shutdown
#!/bin/bash
# I was having trouble with ADB daemon startup, this hack seems to work though it's terrible
adb devices -l > /dev/null
sleep 2
adb devices -l > /dev/null
sleep 2
# Try the nice way
for EMU_ID in `adb devices -l | grep emulator | cut -d' ' -f1`; do
@mikehardy
mikehardy / libvirt-forguests.sh
Created September 4, 2018 12:42
A script to manage suspend/resume/stop for all libvirt guests
#!/bin/sh
#
# Inspired by https://github.com/kumina/shutdown-kvm-guests/blob/master/shutdown-kvm-guests.sh
#
# Configure timeout (in seconds).
TIMEOUT=300
VIRSH=/usr/bin/virsh
# List running domains.
list_domains_by_state() {
@mikehardy
mikehardy / limit.maxfiles.plist
Created August 22, 2019 01:03
Fixing too many open files on macOS
<!-- put this in in /Library/LaunchDaemons/limit.maxfiles.plist -->
<!-- load it with launchctl load /Library/LaunchDaemons/limit.maxfiles.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
@mikehardy
mikehardy / Connect react-native-firebase and expo-apple-authentication
Last active February 24, 2021 11:30
react-native-firebase + apple sign-in (via expo-apple-authentication
/* This is pretty unstructured typescript but gives the idea */
import * as AppleAuthentication from 'expo-apple-authentication';
import { sha256 } from 'react-native-sha256';
private _appleSignIn = async () => {
this.setState({ isSigninInProgress: true });
try {
let linkSuccess = await UserStore.appleSignIn(true);
@mikehardy
mikehardy / README.md
Last active September 2, 2022 19:15
Android emulator performance on macos-11 Github Actions Runners

Performance characteristics of Android emulators on GitHub Actions

Lots of projects need to test android apps, and use GitHub Actions infrastructure to do so.

This document intends to show current timings for a sample workload, to inform what emulators are a good match for testing.

Test Conditions

  • We use the AnkiDroid androidTests
  • they are long enough to execute that they form a nice balance between cold start emulator time so neither dominates