开发者

Setting up OS X for Android development. OR Are *nix environments intentionally prohibitive?

I'm trying to start doing Android development on OS X (trying is the key here). I've read all the fun stuff at http://developer.android.com/sdk/index.html. I get the basics, install the JDK, Eclipse, the Android SDK, the Eclipse plugin and ADT. That's a lot to do but I get the point of each step, so, OK, fine. Then there are a million (OK, a few less than that) little things like adding the location of the SDK to your path. Which ostensibly means editing the .profile file that you can't see in OS X unless you use terminal (or some other method of dealing with hidden files). Ostensible because, for me, that file isn't in the normal place for some reason. Since I don't know where it is, for now I can't run anything from the Android SDK without manually going to the tools directory (and maybe this is the answer to the question that I'm getting to...).

Regardless, once all that is done the SDK location needs to be chosen from within Eclipse after the Android plugin installer went out and did a whole lot of stuff. Stuff that doesn't include installing or locating the SDK. But, OK, done. However, doing so was also supposed to add at least one Target, but it hasn't. Normally that just means qu开发者_运维百科ick search on Google, but apparently none of the documentation on the Internet knows about this case...other than to point me to the Android plugin source code that presents the error (in case you're curious: http://www.netmite.com/android/mydroid/cupcake/development/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/SdkTargetSelector.java).

There just seem to be so many manual steps for what I would think are standard operations; i.e. install SDK and use it. Then, if something goes wrong there's just a bunch "in" knowledge *nix developers just need to know. I'm all for knowing the system you're developing on but I'm not a sysadmin. I just want to write code. Why can't there just be an installer that puts things where they need to go so I can get on with some actual development?

But, I suppose my real question is: if you've followed all the directions on Google's Android developer site for installing all the various bits and there are no Targets, why aren't they there and how is that corrected?

Thanks.


If you do not have a .profile in your home directory, you can simply create it in your home directory - it is just a text file. One of the issues with owning and using a UNIX system is that you are going to have to understand how it works if you are going to develop code for it or use it as a development environment. This is no different than Windows or any other OS.

Take a few moments and read a little about the environment and you will thank yourself in the future. As for "an installer that puts things where ...", that is something that I would take up with your local Google representative. I've worked with plenty of Java-based packages that do this just fine on my MacBook.


First, the .profile file: if it doesn't exist just create it (as others have said) and add whatever you need to it. This should be in you home directory (e.g., /home/YourName/.profile).

As far as having no targets: after you install the SDK you need to have it install whichever platforms you want. From the docs:

The Android SDK starter package includes only a single component: the latest version of the SDK Tools. Included in that component is a tool called Android SDK and AVD Manager that you can use to download other components from the SDK repository site. The tool provides a graphical UI that lets you browse the repository, select new or updated components for download, and then install them in your SDK.

I actually recommend you read that whole page. This whole process is fairly simple/painless if you take the time to read and understand the instructions (and the documentation is fantastic).


Well, I don't know about your other issues, but if you didn't have a .profile file you could always create one in your home directory. I don't know if OS X has one by default that you should use though. For me it wasn't too difficult to set up the Android SDK, but I already use eclipse so maybe that's why.

Are you using the 2.0 SDK? Under the Window menu in eclipse, open up the Android SDK and AVD Manager and under available packages see if there's anything you can install. It sounds like you're missing one of those.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜