Skip to content

Instantly share code, notes, and snippets.

View jokefaker's full-sized avatar

jokefaker

  • www.creams.io
  • Hangzhou China
View GitHub Profile
@jokefaker
jokefaker / gist:854ddf91c228391840f6
Created November 24, 2015 15:33
Xcode 7 Simulator download
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
@jokefaker
jokefaker / APNs push p12 to pem
Last active November 4, 2015 03:22
APNs push p12 to pem
openssl pkcs12 -in MyApnsCert.p12 -out MyApnsCert.pem -nodes
@jokefaker
jokefaker / print line number
Last active August 29, 2015 14:22
iOS project line number
find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs grep -v "^$"|wc -l
# 获取DVTPlugInCompatibilityUUID
defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
# 将获取到的DVTPlugInCompatibilityUUID加入plist
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add <获取到的DVTPlugInCompatibilityUUID>
# 命令合在一起
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
# 重启的时候需要点击load bundle,如果点了skip的话,可以用以下指令,注意后面的版本要跟着变
@jokefaker
jokefaker / PonyDebugger Install
Last active November 4, 2015 14:40
PonyDebugger Install Commands
# 去掉了curl的-sk参数,-s为静默状态(不提示错误),-k为允许不适用ssl
curl https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \
python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
# 报错 Could not find any downloads that satisfy the requirement pybonjour (from ponydebugger),运行下面的命令
# activate your virtualenv
source ~/Library/PonyDebugger/bin/activate
# update the ponyd source
sudo pip install -U -e git+https://github.com/square/PonyDebugger.git#egg=ponydebugger --allow-external pybonjour --allow-unverified pybonjour
# updates chrome dev tools source
@jokefaker
jokefaker / version++.sh
Last active August 29, 2015 14:14
Update Xcode build and version numbers from git
git=`sh /etc/profile; which git`
appBuild=`"$git" rev-list --all |wc -l`
appVersion=`"$git" describe --abbrev=0 --tags`
# set the commit count as app's build,add branch-name as suffix when using debug model
if [ $CONFIGURATION = "Debug" ]; then
branchName=`"$git" rev-parse --abbrev-ref HEAD`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $appBuild-$branchName" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
else
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $appBuild" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
# set the last git tag as app's version
@jokefaker
jokefaker / git-remove-ignored.sh
Last active August 29, 2015 14:05
remove the committed files which had been ignored
git rm --cached `git ls-files -i --exclude-from=.gitignore`
git commit -m 'Removed all files that are in the .gitignore'
git push origin master