Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Hardy mikehardy

View GitHub Profile
@mikehardy
mikehardy / README.md
Last active Sep 2, 2022
Android emulator performance on macos-11 Github Actions Runners
View README.md

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
@mikehardy
mikehardy / Connect react-native-firebase and expo-apple-authentication
Last active Feb 24, 2021
react-native-firebase + apple sign-in (via expo-apple-authentication
View Connect react-native-firebase and 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 / limit.maxfiles.plist
Created Aug 22, 2019
Fixing too many open files on macOS
View limit.maxfiles.plist
<!-- 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 / libvirt-forguests.sh
Created Sep 4, 2018
A script to manage suspend/resume/stop for all libvirt guests
View libvirt-forguests.sh
#!/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 / stop_all_emulators.sh
Created Aug 31, 2018
Android emulator fleet management - shutdown
View stop_all_emulators.sh
#!/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 / start_all_emulators.sh
Last active Aug 31, 2018
Android emulator fleet management - startup
View start_all_emulators.sh
#!/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*)