1.安裝包在此鏈接下載: ? ?http://developer.android.com/sdk/index.html
google GoAgent翻墻不好用,更新了host文件也不行,整了半天,還是一怒之下續簽了vpn賬號。早知如此,何必折騰。~~~~(>_<)~~~~?
更新文件時,Mac的host必須是UTF-8格式的,所以要轉換格式。
將要轉換文件放入專用文件夾,終端進入該文件目錄,命令行:
find *.txt -exec sh -c "iconv -f GBK -t UTF8 {} > {}.txt" \;?
GBK還是別的格式,可以先用chrome打開,查看編碼。
?
2.因為打包的鏈接不好用,所以我自己心急跑去eclipse官網下了個獨立的安裝包。還得選系統是32還是64位的,經研究,我的Mac是64位硬件。但是內核怎么跑的未知。
終端命令:uname -a
Darwin liudeMacBook-Pro.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun? 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
后綴_64,就是64位的Mac。也可以按照下述方法點擊,選擇硬件,然后根據http://support.apple.com/kb/ht3696 查看官網的硬件說明。
點擊:蘋果->關于本機->更多消息->系統報告,選擇軟件
本來這里應該有一行“64位內核和功能擴展”,“是”代表內核按照64位在跑,“否”代表內核按照32位跑。結果我這里木有。
偷了個懶,不想換,于是下了個eclipse32位的,然后不能下安卓包還是不能用,于是回到步驟1,折騰vpn,然后自動下載,判斷Mac是64位的,所以直接下了個64位的,所以要重新安裝eclipse。
于是要卸載之前的安裝,偷懶果然就容易坑娘啊,太特么難卸載了。當然也有可能我沒用慣Mac,我無比懷念Win操作系統。嚶嚶嚶嚶。。。
?
3.Mac卸載Eclipse
先在stackoverflow上找到這個,但是我根目錄那個沒刪,額,因為我昨天還不知道ls -la命令,(ˇ?ˇ)終端渣。。。
Here is my list of things to delete for OSX Mountain Lion
~/.eclipse (folder);
~/Library/Saved Application/org.eclipse.eclipse.savedState;
~/Library/Preferences/org.eclipse.eclipse.plist;
~/Library/Caches/org.eclipse.eclipse;
... and of course the eclipse install folder
?
然后開始裝步驟1下載的安裝包合集,Eclipse裝好后有問題。
Could not create the view: org.eclipse.mylyn.tasks.ui.views.tasks
然后又找了半天,原博這個地址:
http://renyongjie668.blog.163.com/blog/static/160053120104259285352/
內容如下:
使用Eclipse時,遇到了如下的異常,工作空間(workspace)打不開:Could not create the view: Plug-in org.eclipse.jdt.ui was unable to load class? org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.***
我Google了N次,沒有找到答案。
今天上午靈光一現,我換了一個workspace,就能正常打開了,不會有上面的報錯了。我就想到應該是兩個不同的workspace是有區別的,我到報錯的workspace中看,發現有個".metadata"文件夾,里面有200多M的東東,應該是該workspace的一些屬性信息,所以我刪除了.metadata文件夾,然后重新打開Eclipse進入這個workspace,就可以正常工作了。Eclipse重新加載該workspace時,會重新生成.metadata的。
總之,解決方案就是:刪除workspace下的.metadata文件夾,重新打開Eclipse就OK了。
?
下面還有兩條有建設性的評論,摘抄在這里:
a.根據提示,.\.metadata\.plugins\里面的org.eclipse.ui文件夾就可以了,還不用全部重新更新呢
b.刪除整個文件夾以后就相當于恢復了出場設置,你以前的數據庫就都沒有了,刪除這個文件就可以正常啟動com.genuitec.eclipse.ast.deploy.core.prefs
?
總之,因為我是新安裝,直接按照原博主的辦法就搞定了。終端渣的爛筆頭:rm -rf 要刪除的文件夾
?
4.Eclipse->Window->Android SDK Manager
勾選需要的包安裝即可。[Android 4.4W是手表的API,如果做手機應用,還是找最新的4.x.x]
最基本:the SDK Platform ; an emulator system image ; the google APIs
?
5.Mac當前系統到底是按照32還是64位在運行?
官方文檔:Archived - OS X:以 32 位或 64 位內核啟動
http://support.apple.com/kb/HT3773?viewlocale=zh_CN
官方文檔:Mac OS X v10.6:使用 64 位內核的 Mac
http://support.apple.com/kb/HT3770?viewlocale=zh_CN&locale=en_US
對比此文檔,我的MacBook Pro是13年的,所以默認64位啟動。但這個文檔更新已停止,最新更新還是2011年的,所以為什么新的Mac上沒有“64位內核和功能擴展”這一項沒有說明,我認為,應該是后來新出的產品的都默認64位了,所以就不再標注了。
?
但是不放心的我還是查看了一下“/資源庫/Preferences/SystemConfiguration/com.apple.Boot.plist”文件,對于內核模式果然沒有標注,于是我畫蛇添足的加了一行:
sudo systemsetup -setkernelbootarchitecture x86_64
確定修改進文件了,才放心下來。這是病,得治~
---------修改分割線-------
我沒搞清楚,于是還是糾結,據說uname -a出來那行結果root:后的就是內核狀態。我試著改了i386,然后uname -a,root還是_64的后綴,說明這個判斷不準確。
然后繼續找資料,看到這個討論,但是他沒給出處,不過很有根據的樣子,我就姑且信了:
http://apple.stackexchange.com/questions/140938/how-do-i-find-out-of-my-os-x-10-9-4-is-32-bit-or-64-bit
內容:
OS X doesn't really have a single overall mode -- it can easily run different components (different processes, the kernel, etc) in different modes. It also has a multi-architecture binary format, so a single program can include both 32- and 64-bit code, and the OS will simply run it in whatever seems to be the most appropriate mode at the moment.
Over the history of OS X, it's gradually morphed from 32-bit only (through 10.2 I think), to fully 32+64-bit capable (10.6), to mostly-64-bit-only (10.8-10.9). Starting in 10.8, Apple removed the 32-bit versions of the kernel and most built-in apps, meaning that it'll only run on 64-bit CPUs. But it's still fully capable of running old 32-bit programs, and there are even a number of system programs that can run in either mode (again, to provide compatibility with old 32-bit software). The most visible example of this is the System Preferences, which normally runs in 64-bit mode, but can quit & relaunch itself in 32-bit mode to run old 32-bit-only preference panes (if you can still find one).
Note that there've never been separate 32- and 64-but versions of OS X. 10.6, for example, would install exactly the same on a 32- or 64-bit computer, and then decide at runtime which mode each program should run in.
Summary: it's not an entirely a meaningful question, but to the extent that it's meaningful Mavericks is a 64-bit OS.
基本上還是解釋的很詳細的,也就是說10.8以后的osX系統都是直接64位運行,但是可以兼容32位的程序。在具體運行的時候由系統判斷。
---------------修改結束分割線------------------
好了,可以開始學Android programming了,呼~