Mac OS上进行android开发

jc posted @ 2014年2月21日 21:31 in Pandaboard ES , 2701 阅读

1. 开机设置ok后,打开app store升级系统到10.9.1,好处是能免费获取那几款办公软件,嘿嘿!

 

2. 安装Xcode,打开终端,输入make之类的指令会提示安装command line tools,安装。jdk默认就有了,不用再装。

 

3. 安装homebrew,上其官网下载。homebre对于习惯了apt搞掂一切的人来说真是福音。使用方法brew help。

 

4. 从android网站上下载已经配置好的eclipse,叫ADT,安装到某位置。

 

5. 创建一个大小写敏感的分区镜像:

 

hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg

 

其中40g是指大小,基本够用了。~/android.dmg指定生成镜像位置和名字,不过实际生成的镜像文件名字叫android.dmg.sparseimage

 

然后挂载:

 

hdiutil attach ~/android.dmg.sparseimage -mountpoint /Volumes/android

 

实际的挂载点随自己喜欢了,将android源码移动到/Volumes/android中。

 

6.  确保安装了git,python,make(3.82)gnupg

 

7. 进入android4.4,编译,选择了aosp_arm-env

 

PS:

实际在将一份代码移动到/Volume/android时,我犯了错误。从大小写不敏感的分区到敏感分区,导致许多文件的丢失。

后来决定在此分区下载一份代码,结果历时8天。这么艰辛,所以想分享一些东西而让后来者少走弯路。

首先,除非网速很快,否则在合理的时间内同步完代码是不可能的。因为众所周知的原因,网络会周期性的断开,网上流传的循环脚本很低效。

android里面不是每个project都能断点续传的。比如framework/base,有1G多大小,需要保证很长时间的稳定网络,否则从新来过。

这样折腾之后,你会发现project目录下产生了大量的tmp开头的临时文件,这些都是垃圾。而每次都是百分之八九十就出错是很抓狂的,循环脚本根本无法解决这个问题。再者,由于网络不稳定,同步的进程经常会僵死。很多时候你挂机一晚上,早上起来一看,就那么不动了一晚上。这个循环脚本也无法解决。

那怎么解决的呢?vpn,代理,这些才是正道。

而进程僵死的问题,挂了vpn也还是会偶尔出现的,这就需要-j参数来限定线程数,经验而言线程越多死得越频繁,这个不知是网络原因还是python脚本问题。

另外,-c参数能使repo只同步你指定分支,所以能大大减少数据量,加快同步速度。

完成之后,repo forall -c git gc能优化git仓库文件,加上删除临时文件,最终同步完得代码大小时20G。

 

作为一个码农,这些是饭碗。我安分守纪,仅想靠劳动混口饭吃怎么就那么辛酸。

就为了一泄私愤,搞这些东西,浪费了电,浪费了带宽,更浪费了无价的时间。

所以,某党和某人,你们不得好死!

 

 

 

 

Avatar_small
yacca 说:
2014年12月20日 22:21

和你有着非常相似的经历,同步代码真是件痛苦的事。想请教一下,你能详细说明一下那些 tmp 开头的临时文件吗?我没找到:-(

Avatar_small
JayHare 说:
2020年11月21日 08:18

Providing programming explanation in a blog form is sometimes not helpful. People need some direct interaction like getting  social studies homework helper  from someone. A video would have been way better than to type everything. That way results could have been shown.

Avatar_small
papers writing servi 说:
2022年1月24日 05:19

“Will you deliver top-quality if I hire you to do my assignment?” Quality is our foremost priority, and we have a competent team of editors and quality assurance agents to assure it. They will check your work thoroughly to ensure it has no mistakes, explores the topic conclusively, and meets all your requirements.

Avatar_small
AP 10th General Scie 说:
2022年9月17日 07:16

All Andhra Pradesh State Class 10th (SSC) Students can download AP SSC Science model paper 2023 with Answer solutions in Chapter by Chapter for Physical Science, Chemistry, Biological Science and Environmental science for AP SSC Science Model Paper 2023 examination test for Unit Test-1, Unit Test-2, AP 10th General Science Question Paper Unit Test-3, Unit Test-4, and Quarterly, Half Yearly, Pre-Final with Annual final examination tests 2023. The Andhra Pradesh State Board of Secondary Education has published the General Science model paper with study material with practice paper with mock test question bank as AP 10th Biology, PS, Chemistry Model Paper 2023 for all examination tests conducted by BSEAP.

Avatar_small
https://www.lunwenhu 说:
2024年3月28日 22:08

为了保障您的隐私和安全,我们采取了严格的保密措施,确保您的个人信息和订单细节得到最大程度的保护。我们明白论文代写对于您的学术生涯至关重要,因此我们努力提供可靠、高效的服务,让您从繁重的学业压力中解脱出来。


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter