Skip to content

Instantly share code, notes, and snippets.

View elsnosrap's full-sized avatar

Ellie Parsons elsnosrap

  • Ovia Health
  • Providence, RI
  • 04:54 (UTC -05:00)
View GitHub Profile
@elsnosrap
elsnosrap / remove.sh
Created May 17, 2014 19:13
Shell script to remove one or more applications from one or more Android devices / emulators connected via adb.
#!/bin/bash
# Variables used throughout script
APP_NAME[0]="com.brightcove.app1"
APP_NAME[1]="com.brightcove.app2"
NUMAPPS=${#APP_NAME[@]}
# Run adb devices once, in event adb hasn't been started yet
BLAH=$(adb devices)
@elsnosrap
elsnosrap / logcat.sh
Created May 17, 2014 19:17
Convenience wrapper for running Android logcat in terminal.
#!/bin/bash
# logcat.sh - Script to display logcat for a single app
# Enter the app's package name in the following variable
APP_ID="com.brightcove.app1"
APP_ID2="com.brightcove.app2"
# The regular expression to be used when filtering out lines
FILTER_SUPPRESS_REGEX="onMeasure|setMeasuredDimension"
@elsnosrap
elsnosrap / adb-wrapper.sh
Created May 17, 2014 19:19
A useful shell script that wraps Android adb commands when multiple devices or emulators are connected. The script will prompt for a device or emulator to run the command against, if it detects multiple devices / emulators.
#!/bin/bash
# This is a wrapper for adb. If there are multiple devices / emulators, this script will prompt for which device to use
# Then it'll pass whatever commands to that specific device or emulator.
# Run adb devices once, in event adb hasn't been started yet
BLAH=$(adb devices)
# Grab the IDs of all the connected devices / emulators
IDS=($(adb devices | sed '1,1d' | sed '$d' | cut -f 1 | sort))
@elsnosrap
elsnosrap / netdelay.sh
Created May 23, 2014 16:42
Bash script to slow down a network connection on linux.
#!/bin/bash
# CONSTANTS
# The network device to slow down - should be the wireless adapter.
NETWORK_DEVICE="wlan0"
# Network Delays. These values were pulled from http://developer.android.com/tools/devices/emulator.html#netdelay
# GPRS MIN = 150, MAX = 550
# EDGE MIN = 80, MAX = 400
# 3G MIN = 35, MAX = 200