准备有空看看iOS开发,首先便是装个虚拟机。基本上按照这篇VMware9虚拟机安装MAC OS X Mountain Lion 10.8.2详细图文教程来,过程倒是也很顺利,也没遇到什么问题。
装完系统之后装XCode,安装文件在Windows下面,按说已经装了VMware Tools,应该可以通过VMware Shared Folders来共享文件的,结果在桌面却没有找到传说中的VMware Shared Folders,看教程里的贴图似乎也没有。于是用Samba解决,安装过程也很顺利,考虑到桌面系统可能比较耗资源,新建虚拟机的时候我分配了最大的2个内核和4G内存,有文章提到这样会导致XCode安装失败,我这里倒是挺正常的。
再回到这个VMware Shared Folders,看了下鼠标能够直接自由移动了,VMware Tools应该是正常的,就是桌面没有那个文件夹。搜了一下,讲到的大部分都是怎么删掉这个的,记得有一次启动的时候似乎看到了桌面的VMware Shared Folders一闪而过,一搜还真找到些线索:在这篇:Mac OS X Lion 10.7.3 VMware Image – Release Notes + Links的一个回复里头提到了解决方法:
Maybe a very late reply but here is a solution for having vmware shared folders always visible. Ofcourse first you must edit the settings for the virtual machine and under options enable shared folders:
Step 1: (Make sure you are quick on this)
Soon as your mac desktop appears double click on vmware shared folders before it disappears so that the shared folder window will open.
Step 2:
On the shared folder window right click the label on the top centre of the window that says vmware shared folder and you will have options for some other directories like “my mac” or whatever you named your account. Click on that directory and there you will see your vmware shared folder.
Step 3:
Drag that vmware shared folder to the dock so that a shortcut is placed in the dock and voila the shared folders will always be available to you from now on
大概意思就是启动时在桌面上的VMware Shared Folders快捷方式消失前双击,最后把它拖到Dock上。倒确实能用,不过比较狗血,你不一定能有那么快,而且明显治标不治本。于是再找了一下,在一个讲怎么删除这个VMware Shared Folders的帖子:Getting rid of “VMware Shared Folders” under OS X 找到些线索,他说要删除:
/Library/LaunchDaemons/com.vmware.launchd.tools.plist
这个看起来是个自动启动的东西,里头其实最后就是这么一个命令:
/Library/Application Support/VMware Tools/services.sh --start
手动执行(空格前要加\)时会报一些错,但是桌面的快捷方式也已经创建了。看了一下这个service.sh,大概就是load两个kext,然后mount,最后创建快捷方式。其实启动之后其实前两步都没问题,mount之后/Volumes/VMware Shared Folders也是存在的,就是不知道为什么快捷方式创建之后又会消失。
这样如果重启的话还会有问题,所以比较靠谱的还是自己创建一个快捷方式:
ln -s /Volumes/VMware\ Shared\ Folders/ ~/Desktop/VMware\ Shared\ Folders
这样就可以了。至于为什么自动创建的快捷方式会消失,这个待查。
最后,有什么iOS开发的书推荐么?最好是快速入门的那种。谢谢