Skip to content

Instantly share code, notes, and snippets.

View shazron's full-sized avatar
😆

Shazron Abdullah shazron

😆
View GitHub Profile
@shazron
shazron / list_connected_ios_devices.sh
Created April 3, 2014 23:15
List connected iOS devices
system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'
@shazron
shazron / cb-5103.patch.md
Last active December 25, 2015 18:09
Patch Cordova 3.1.0 for CB-5103 (https://issues.apache.org/jira/browse/CB-5103)
  1. Make sure you have run this at least once in a created project to get the cordova-ios library:

     cordova platform add ios
  2. Run these commands to back up and patch the existing run script:

     cp -f ~/.cordova/lib/ios/cordova/3.1.0/bin/templates/scripts/cordova/run  ~/.cordova/lib/ios/cordova/3.1.0/bin/templates/scripts/cordova/run.orig
     curl https://raw.github.com/csantanapr/cordova-ios/fb5428d01b1469a783959ac5b251cf27d340102a/bin/templates/scripts/cordova/run > ~/.cordova/lib/ios/cordova/3.1.0/bin/templates/scripts/cordova/run

Now, when you create a new project, it will contain the updated script. If you want to just replace the existing script in an already created project, just replace the platforms/ios/cordova/run file with the ~/.cordova/lib/ios/cordova/3.1.0/bin/templates/scripts/cordova/run file.

@shazron
shazron / debug.phonegap.md
Last active December 23, 2015 13:49
Debug PhoneGap Applications
  1. Use desktop Safari 7.x (for both a device and the iOS Simulator): http://moduscreate.com/enable-remote-web-inspector-in-ios-6/
  2. Use Adobe Edge Inspect (formerly known as Shadow), available on the free tier of Adobe Creative Cloud: http://html.adobe.com/edge/inspect/
  3. Use Weinre (you must self host), which Adobe Edge Inspect is based on: https://github.com/apache/cordova-weinre
  4. Use http://debug.phonegap.com, a hosted version of Weinre, part of Adobe PhoneGap Build's service. Don't forget to choose a guid only you know, if not other people can inspect your device!
  5. https://github.com/google/ios-webkit-debug-proxy/ (this is only last since I haven't used it to form an opinion. This allows you to use the Chrome Web Inspector)
@shazron
shazron / ios7.phonegap.cordova.js
Last active June 9, 2025 07:29
PhoneGap / Apache Cordova - top margin for iOS 7
// Pre-requisites:
// 1. Device core plugin
// 2. Splashscreen core plugin (3.1.0)
// 3. config.xml: <preference name="AutoHideSplashScreen" value="false" />
// 4. config.xml: <preference name="DisallowOverscroll" value="true" />
function onDeviceReady() {
if (parseFloat(window.device.version) >= 7.0) {
document.body.style.marginTop = "20px";
// OR do whatever layout you need here, to expand a navigation bar etc
@shazron
shazron / ios-deploy.lldb.patch
Last active December 22, 2015 19:08
patch for lldb support in ios-deploy
From d2378b8d4d3634bcfd29df9999dcc7d5ace77673 Mon Sep 17 00:00:00 2001
From: Connor Dunn <[email protected]>
Date: Fri, 30 Aug 2013 09:55:46 +0100
Subject: [PATCH] Use LLDB rather than GDB.
---
ios-deploy.c | 228 ++++++++++++++++++++++++++++++++++-------------------------
1 file changed, 130 insertions(+), 98 deletions(-)
diff --git a/ios-deploy.c b/ios-deploy.c
@shazron
shazron / list_iphone_certs.sh
Created July 27, 2013 08:13
List the iOS Developer certs in your keychain.
#!/bin/bash
security find-identity | sed -n 's/.*\("[^"]*"\).*/\1/p' | grep 'iPhone'
@shazron
shazron / get_bundle_id.sh
Last active August 24, 2021 12:31
Get the bundle id of an Xcode project. Run this in the same location of your .xcodeproj file
#!/bin/bash
# Run this in the same location as your .xcodeproj file
plutil -convert json -r -o - `xcodebuild -showBuildSettings | grep PRODUCT_SETTINGS_PATH | awk -F ' = ' '{print $2}'` | grep CFBundleIdentifier | awk -F ' : ' '{print $2}' | cut -d'"' -f2
@shazron
shazron / list_app_ids_in_provisioning_profiles.sh
Last active December 20, 2015 07:29
List app ids contained in Provisioning Profiles installed on your system. So you can grep for a bundle id.
#!/bin/bash
# You could also launch Xcode Organizer directly to the Provisioning Profiles section (to check for validity) by running:
# open ~/Library/MobileDevice/Provisioning\ Profiles/*
#
# In Xcode 5, you can't get a whole list anymore in Xcode Organizer - you will need to download the iPhone Configuration Utility.
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
<div class="wrap">
<input type="checkbox" id="s1" />
<label class="slider-v1" for="s1"></label>
<input type="checkbox" id="s2" checked="" />
<label class="slider-v1" for="s2"></label>
</div><!--/wrap-->
<div class="wrap">
#if __has_feature(objc_arc)
AudioServicesCreateSystemSoundID((__bridge CFURLRef)audioPath, &completeSound);
#else
AudioServicesCreateSystemSoundID((CFURLRef)audioPath, &completeSound);
#endif