brew update报错

问题描述:运行brew update,报错
error: The following untracked working tree files would be overwritten by merge:
Library/Aliases/libtcnative
Library/Aliases/myrepos
Library/Contributions/example-formula.rb
Library/Formula/acme.rb
Library/Formula/activemq-cpp.rb
Library/Formula/ahcpd.rb
Library/Formula/analog.rb
Library/Formula/ansible.rb
Library/Formula/apple-gcc42.rb
Library/Formula/argus-clients.rb
Library/Formula/argus.rb
Library/Formula/babeld.rb
Library/Formula/bacula-fd.rb
Library/Formula/bgpq3.rb
Library/Formula/bitchx.rb
Library/Formula/brag.rb
Library/Formula/cdlabelgen.rb
Library/Formula/charm-tools.rb
Library/Formula/clipper.rb
Library/Formula/clojurescript.rb
Library/Formula/datomic.rb
Library/Formula/dieharder.rb
Library/Formula/dmalloc.rb
Library/Formula/dtrx.rb
Library/Formula/ejdb.rb
Library/Formula/electric-fence.rb
Library/Formula/etcd.rb
Library/Formula/etcdctl.rb
Library/Formula/fdclone.rb
Library/Formula/flowgrind.rb
Library/Formula/fswatch.rb
Library/Formula/gammu.rb
Library/Formula/gcab.rb
Library/Formula/git-cal.rb
Library/Formula/gtkspell3.rb
Library/Formula/hamsterdb.rb
Library/Formula/haxe.rb
Library/Formula/headphones.rb
Library/Formula/htmlcleaner.rb
Library/Formula/irrtoolset.rb
Library/Formula/juju.rb
Library/Formula/kimwitu++.rb
Library/Formula/kstart.rb
Library/Formula/laszip.rb
Library/Formula/libatomic_ops.rb
Library/Formula/libav.rb
Library/Formula/libcello.rb
Library/Formula/libcppa.rb
Library/Formula/libdrawtext.rb
Library/Formula/libftdi0.rb
Library/Formula/libgsm.rb
Library/Formula/libiscsi.rb
Library/Formula/liblacewing.rb
Library/Formula/libnatpmp.rb
Library/Formula/libqxt.rb
Library/Formula/libresample.rb
Library/Formula/lmdb.rb
Library/Formula/mbelib.rb
Library/Formula/mboxgrep.rb
Library/Formula/mecab-unidic.rb
Library/Formula/mergelog.rb
Library/Formula/midicsv.rb
Library/Formula/mitmproxy.rb
Library/Formula/mkvtomp4.rb
Library/Formula/mlt.rb
Library/Formula/mm-common.rb
Library/Formula/moc.rb
Library/Formula/mongo-c.rb
Library/Formula/monkeysphere.rb
Library/Formula/mp3blaster.rb
Library/Formula/msitools.rb
Library/Formula/msktutil.rb
Library/Formula/n.rb
Library/Formula/namebench.rb
Library/Formula/nanomsg.rb
Library/Formula/neko.rb
Library/Formula/ninja-ide.rb
Library/Formula/npth.rb
Library/Formula/ondir.rb
Library/Formula/ori.rb
Library/Formula/osxfuse.rb
Library/Formula/owamp.rb
Library/Formula/pgrouting.rb
Library/Formula/pjsip.rb
Library/Formula/pktanon.rb
Library/Formula/pmccabe.rb
Library/Formula/polygen.rb
Library/Formula/ponysay.rb
Library/Formula/proftpd.rb
Library/Formula/q.rb
Library/Formula/randomize-lines.rb
Library/Formula/rbenv-readline.rb
Library/Formula/re2.rb
Library/Formula/reaver.rb
Library/Formula/sbuild.rb
Library/Formula/sdl2.rb
Library/Formula/sdl2_image.rb
Library/Formula/sdl2_mixer.rb
Library/Formula/sdl2_net.rb
Library/Formula/sdl2_ttf.rb
Library/Formula/shellinabox.rb
Library/Formula/slimerjs.rb
Library/Formula/snzip.rb
Library/Formula/spim.rb
Library/Formula/sslh.rb
Library/Formula/stlviewer.rb
Library/Formula/strongswan.rb
Library/Formula/sysbench.rb
Library/Formula/tcpsplit.rb
Library/Formula/texapp.rb
Library/Formula/tinyxml.rb
Library/Formula/tlassemble.rb
Library/Formula/tmux-mem-cpu-load.rb
Library/Formula/tomcat-native.rb
Library/Formula/tpp.rb
Library/Formula/tractorgen.rb
Library/Formula/typesafe-activator.rb
Library/Formula/uberftp.rb
Library/Formula/v.rb
Library/Formula/viewglob.rb
Library/Formula/voltdb.rb
Library/Formula/vstr.rb
Library/Formula/watchman.rb
Library/Formula/wimlib.rb
Library/Formula/wy60.rb
Library/Formula/xcproj.rb
Library/Formula/xplot.rb
Library/Formula/z80asm.rb
Library/Formula/z80dasm.rb
Library/Formula/zpython.rb
Library/Homebrew/cxxstdlib.rb
Library/Homebrew/install_renamed.rb
Library/Homebrew/os.rb
Library/Homebrew/resource.rb
Library/Homebrew/software_spec.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

问题解决
cd `brew --repository`
git reset --hard HEAD
brew update
不行的话试试如下:
cd `brew --repository`
git reset --hard origin/master
brew update

NSInvalidArgumentException’, reason: ‘Cannot create an NSPersistentStoreCoordinator with a nil model’

问题描述:NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'
问题解决:原因是缺少.momd文件,即缺少.xcdatamodeld文件,在工程中加上就行

SSH into iPhone over USB without Wi-Fi

最近在做iPhone守护进程,通过ssh和scp等脚本安装,速度总是不理想。同事告知如下可以通过usb运行ssh,找到如下好东西,附上安装运行方法。

1.准备python环境并下载usbmuxd
2.把手机通过USB连接Mac
3.运行python usbmuxd-1.0.8/python-client/tcprelay.py -t 22:2222
4.运行ssh root@localhost -p2222

这里有一篇for windows的:http://www.securitylearn.net/2012/10/11/ssh-into-iphone-over-usb-without-wi-fi/

CocoaPods错误

问题描述:用“pod update”更新,遇到如下错误

Pull is not possible because you have unmerged files.

Please, fix them up in the work tree, and then use 'git add/rm <file>'

as appropriate to mark resolution, or use 'git commit -a'.

问题解决

A bug was found in libgit2 and they had to execute a force push on the specs repo. This is what broke everyone's CocoaPods setup.

You can find the official post about this issue on the CocoaPods blog :http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/

The recommended way to fix your setup is to execute the following commands :

$ pod repo remove master
$ pod setup

If that doesn't work, you can also delete manually all your cached specs :

$ rm -rf ~/.cocoapods/
$ pod setup

Xcode创建动态库

1.用Xcode打开如下2个xcspec文件:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneOSPackageTypes.xcspec
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX Package Types.xcspec

2.把MacOSX Package Types.xcspec中Identifier为com.apple.package-type.mach-o-dylib的item复制到iPhoneOSPackageTypes.xcspec

3.把MacOSX Product Types.xcspec中Identifier为com.apple.product-type.library.dynamic的item复制到iPhoneOSProductTypes.xcspec

以上为真机,模拟器类似,路径在:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/

 

1.把/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/Framework & Library/Cocoa Touch Static Library.xctemplate整个文件夹复制并改名为Cocoa Touch Dynamic Library.xctemplate

2.修改Description中的"a static library"为"a dynamic library"
修改Identifier中的"cocoaTouchStaticLibrary"为"cocoaTouchDynamicLibrary"
修改Description中的".static"为".dynamic"

 

1.Installation Directory设置为@executable_path/