Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
tell application "Google Chrome"
activate
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
if (count every window) = 0 then
make new window
end if
set found to false
set theTabIndex to -1
<?php
$devices = explode("\n", shell_exec("adb devices"));
$pattern = "/([a-zA-Z0-9]+)\s+device/";
$zip = new ZipArchive;
if ($zip->open($argv[1]) === TRUE) {
$zip->extractTo('.', 'AndroidManifest.xml');
$zip->close();
}
@j796160836
j796160836 / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@j796160836
j796160836 / ListInstalledPackeges.sh
Last active June 16, 2019 17:27 — forked from davidnunez/gist:1404789
Get installed packages and convert into command format (Just copy & paste to uninstall whatever packages.)
#!/bin/bash
DEVICE=$1
if [ -z $DEVICE ]; then
DEVICE=`adb devices | sed '/List of devices/d' | head -n 1 | awk '{print $1}'`
fi
if [ -z "$DEVICE" -o "$str" == " " ]; then
echo "Please connect a device."
exit 1
fi
adb -s $DEVICE shell 'pm list packages -f -3' | sed -e 's/.*=//' | sed -e "s/^/adb -s $DEVICE uninstall /" | sort | less
@j796160836
j796160836 / AdbDownloadApk.sh
Last active June 16, 2019 17:27 — forked from anonymous/download_apk.sh
Download apk from package name
#!/bin/sh
if test $# -lt 1 ; then
echo "Usage: download_apk.sh <GooglePlayPackageName>"
exit 1
fi
PACKAGE=$1
APK_PATH=`adb shell pm list packages -f -3 | grep $PACKAGE | cut -d'=' -f 1 | cut -c9-`
echo "Pulling $APK_PATH from device"
echo `adb pull ${APK_PATH} ./${PACKAGE}.apk`
#!/bin/sh
if test $# -lt 1 ; then
echo "Usage: download_apk.sh <target-dir>"
exit 1
fi
for APK_PATH in $(adb shell pm list packages -f -3|sed 's/package://g'|sed s/=.*$//g) ; do
echo -n "Pulling $APK_PATH from device... "
adb pull $APK_PATH $1
done
@j796160836
j796160836 / Foreground.java
Created September 14, 2015 10:38 — forked from steveliles/Foreground.java
Class for detecting and eventing whether an Android app is currently foreground or background (requires API level 14+)
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@j796160836
j796160836 / RecorderService.java
Created October 30, 2015 09:59 — forked from qihnus/RecorderService.java
a minimalist example of Android accessibility service
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class RecorderService extends AccessibilityService {
static final String TAG = "RecorderService";
private String getEventType(AccessibilityEvent event) {