Qt For Android 配置(Qt5.11 Ubuntu16.04)
一、下载
http://download.qt.io/archive/qt/5.11/5.11.1/
选择下面的这个
![695ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/695ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
tools_r25.2.3-linux.zip(SDK tools)
android-ndk-r13b-linux-x86_64.zip(NDK)
二、安装
1、解压zip
将两个zip文件解压到/opt目录下:
sudo unzip tools_r25.2.3-linux.zip -d/opt
sudo unzip android-ndk-r13b-linux-x86_64.zip -d/opt
2、安装Ant
使用命令:
sudo apt-get install ant
3、安装OpenJDK
使用命令:
sudo apt-get install openjdk-8-jdk
4、安装Qt
cd ~/Downloads
sudo chmod +x qt-opensource-linux-x64-5.11.1.run
sudo ./qt-opensource-linux-x64-5.11.1.run
一直下一步,直到出现下图,把勾全部选上。
![6b5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p04.5ceimg.com/content/6b5ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
5、安装Android SDK
先创建一个文件夹:
cd /opt
sudo mkdir android-sdk
将解压出来的tools放入android-sdk文件夹中
sudo mv tools android-sdk
安装sdk:
cd /opt/android-sdk/tools
sudo ./android update sdk --no-ui
然后不断选择yes,就开始下载安装。
注意:这个过程很慢长,完成后android-sdk文件夹下会有这些东西:
![6d5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6d5ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
安装相关库文件:
sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
6、配置Qt
![6f5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p03.5ceimg.com/content/6f5ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
打开qt,点击tools
![715ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p02.5ceimg.com/content/715ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
选择options
![745ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p03.5ceimg.com/content/745ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
选择devices
![765ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/765ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
点击browse,选择如下路径
![795ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p03.5ceimg.com/content/795ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)
如果这里出现没勾的,把它勾上
![7b5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p02.5ceimg.com/content/7b5ae62e-1524-eb11-8da9-e4434bdf6706.png)
![6a5ae62e-1524-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/6a5ae62e-1524-eb11-8da9-e4434bdf6706.png)