---
title: "用Genymotion与Intellij搭建ubuntu下的android开发环境"
author: "Iam42"
date: "2013-08-31T15:13:26Z"
tags: []
categories: ["开源软件"]
slug: "genymotion-intellij-ubuntu-android"
draft: false
lastmod: "2013-08-31T15:13:26Z"
id: 1934730
url: "https://iam42.iteye.com/blog/1934730"
---

一.安装android sdk

1. 访问[http://developer.android.com/sdk/index.html](http://developer.android.com/sdk/index.html)，下载对应系统的sdk。  
   注意只下载sdk就好了，不需要下载ADT，Eclipse也不是推荐使用的IDE。
2. 设置环境变量，把sdk下的tools目录加到PATH里。如下面的.bashrc：
3. ```
    export ANDROID_SDK_ROOT="/home/zhang/android/sdk"
    PATH="$PATH:ANDROID_SDK_ROOT/tools:ANDROID_SDK_ROOT/platform-tools:PATH"
   export PATH
   ```
4. 安卓默认是用ant来打包的，如果你的系统没有ant，需要安装。可以到[Apache Ant](http://ant.apache.org/bindownload.cgi)下载。一般的mac或者linux都是自带的

二. 安装Intellij

0.这货是什么：

集成开发环境

 

1.安装jdk

参照[http://blog.csdn.net/snowdream86/article/details/6677450](http://blog.csdn.net/snowdream86/article/details/6677450)

 

2.下载

[http://www.jetbrains.com/idea/](http://www.jetbrains.com/idea/)

 

3.安装

进入bin下，执行./idea.sh

如果按第一步的配置，ANDROID\_SDK\_HOME应该是正常配置好的了，下载安装好IntelliJ IDEA后，直接可以使用了。

 

三. genymotion安装：

0\. 这货是什么：

官方说法：

Genymotion is a complete set of tools that provides a virtual environment for Android. It can be very useful for developers, testers, salesman or even gamers.

简而言之：

安卓手机模拟器

 

1.注册：

[https://cloud.genymotion.com/page/customer/login/](https://cloud.genymotion.com/page/customer/login/)

 

2.下载安装 virtualBox

[https://www.virtualbox.org/wiki/Linux\_Downloads](https://www.virtualbox.org/wiki/Linux_Downloads)

似乎可以直接apt-get得到

 

3.下载genymotion

[https://cloud.genymotion.com/page/launchpad/download/](https://cloud.genymotion.com/page/launchpad/download/)

 

4.安装genymotion

 

```
chmod +x [INSTALLER_PATH]/genymotion-[VERSION]_[ARCH].bin
cd [INSTALLER_PATH]
./genymotion-[VERSION]_[ARCH].bin
```

 

 

5.运行genymotion

进入安装目录

 

```
./genymotion
```

 

四.在Intellij中配置genymotion

1.下载插件：

- Start your IDE
- Go to the "File/Settings" menu
- In the new opened window, select the "Plugins" section and then click on "Browse repositories..." button (on the bottom right)
- In the list, click on Genymotion and click on "download and install" button (on the top left)
- Click on "Yes" button to begin
- Click on "Close" button to leave the browse repository window
- Click on "OK" button to leave the settings window
- IntelliJ asks for restart. Accept by clicking on "Restart" button

2.使用

点击工具栏中的genymotion小按钮，选择一个设备start

然后运行程序，chooes device的时候选择choose a running device即可

这样的速度还不错

 

参考文献

\--------------------------------------------

[https://cloud.genymotion.com/page/doc/](https://cloud.genymotion.com/page/doc/)