安装Genymotion
因为Genymotion 模拟器是基于virtualbox的, 所以务必首先安装virtualbox虚拟机. 由于kali linux 源自带的virtualbox是非常旧的. 所以最好还是去官方网站下面下载一个最新版本的virtualbox安装, 最新的5.0版本新增了不少特性, 优化了性能, 体验好了不少.
https://www.virtualbox.org/wiki/Linux_Downloads
安装virtualbox遇到这个问题:
root@kali:~# virtualbox
WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-amd64.
You will not be able to start VMs until this problem is fixed.
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
然后在这个网址找到解决办法:https://forums.kali.org/showthread.php?31306-VirtualBox-DKMS-problems
步骤是:
1.去掉kali源,kali sana sources: deb http://http.kali.org/kali kali-rolling main contrib non-free
2. 运行: apt-get update && apt-get dist-upgrade -y
3. 重启reboot
4. You install your headers: apt-get install linux-headers-$(uname -r)
5. apt-get install virtualbox-guest-x11
6. 运行virtualbox就ok了
安装好virtualbox之后就可以去安装Genymotion了.首先去官网下载Genymotion最新版. 下载地址在这里 https://www.genymotion.com/#!/download 注意,下载前请先注册下. 版本的选择在网页的最下方,选择 Linux平台的 Debian. 博主用的是kali linux 2.0 64位,自然是选择Debian 64位的安装文件.下载回来以后是一个bin文件, 首先需要赋予可执行权限.
chmod +x genymotion-2.5.2_x64_debian.bin
然后它默认会安装在opt/genymobile/genymotion下
运行:
root@jimo:/opt/genymobile/genymotion# ./genymotion
然后添加一个虚拟机进行下载安装:
由于国内限制,下载速度很慢,可以去日志文件里找到下载地址通过其他工具下载,具体看:
http://blog.csdn.net/qing666888/article/details/51622762
错误解决
遇到如下错误:
$ adb devices
List of devices attached
adb server version (32) doesn't match this client (36); killing...
error: could not install *smartsocket* listener: Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
原因是adb冲突了,解决方法看:
http://blog.csdn.net/m_changgong/article/details/51730664
完了记得重启。
然后运行:
tns run android --emulator
启动模拟器即可。