`
xuela_net
  • 浏览: 496899 次
文章分类
社区版块
存档分类
最新评论

android genymotion模拟器怎么使用以及和google提供的模拟器性能对比

 
阅读更多

genymotion是一款号称速度最快性能最好的android模拟器,它基于Oracle VM VirtualBox。支持GPS、重力感应、光、温度等诸多传感器;支持OpenGL 3D加速;电池电量模拟;能够运行在windows、linux、mac系统下;并提供的有eclipse下的插件,可以支持在eclipse下进行应用开发测试。

(一)首先介绍下如何下载并运行genymotion模拟器

http://www.genymotion.com/网站上点击sign up按钮开始进行注册。

填写相关注册信息

完成注册后会提示你有邮件发到你上一步填写的邮箱去激活账户

在邮箱里激活刚注册的账户

激活刚注册的账户会提示你可以开始下载genymotion

登陆刚注册的账户

选择下载genymotion

选择包含virtualbox的genymotion-1.0-vbox.exe进行下载

下载完genymotion-1.0-vbox.exe,运行该exe按照默认的选项一路安装下去即可

安装完成后在桌面上会发现genymotion命令行工具图标:Genymotion Shell;genymotion程序图标:Genymotion:Genymotion;以及虚拟机Oracle VM VirtualBox的图标。

点击Genymotion图标运行genymotion会提示你需要创建虚拟设备,点击yes按钮开始创建虚拟设备。

使用注册好的用户名和密码连接服务器

连接好服务器后开始添加自己需要的虚拟机

按Next按钮创建虚拟设备

点击Next

点击Create按钮

创建完成

运行虚拟设备

设置android SDK目录

再次运行genymotion中的虚拟设备

使用起来确实比google提供的模拟器流畅不少

(二)安装安兔兔进行测分

genymotion模拟器的安兔兔测试得分

google模拟器的安兔兔测试得分:

安兔兔测得在同一台电脑上同是Nexus 480X800的虚拟设备genymotion分值高达13836,而http://blog.csdn.net/yearafteryear/article/details/9255431测试得到的google模拟器只有区区953,genymotion在各项参数上均表现好不少。

(三)在eclipse下安装genymotion插件

启动eclipse,选择Help->Install New Software菜单

点击add按钮

填入Genymobile、http://plugins.genymotion.com/eclipse点击OK按钮

选择genymotion相关插件选项进行安装

接受相关协议

忽略相关警告

提示重启eclipse即已经完成genymotion插件的安装,点击yes按钮重启eclipse

重启eclipse会在工具栏上发现genymotion的图标,点击即可启动该插件。

第一次启动genymotion插件需要填入genymotion的安装目录:C:\Program Files\Genymobile\Genymotion

(四)调试应用程序,这里我调试一个OpenGL的程序。发现OpenGL的程序在genymotion上运行的很好。

点击eclipse上的genymotion插件图标,在弹出的对话框选择以前创建的虚拟设备启动。

在eclipse下的工程项目上单击鼠标右键,在弹出的菜单里选择Run as->Run Configurations.

在Run Configurations对话框选择下面的选项即可

之后运行工程项目即可发现当前的这个opengl项目在genymotion上能很流畅的运行

(五)genymotion shell命令行工具

可在genymotion shell下输入相关指令获取一些信息或者设置一些参数之类

genymotion shell支持的命令行如下所示:

Command line options

  • -h Print help
  • -r ip_address Connect to specific Genymotion Virtual Device
  • -c "command" Execute the given command in genyshell environment and return
  • -f file Execute the content of the file. Each command per line

Available commands

  • battery getmode
    Return the current battery mode of the selected virtual device. The mode can only be:
    • host: The virtual battery reflect the host battery (if exists)
    • manual: In this mode, you can set the level and status battery values
  • battery setmode
    Set the battery mode. The mode can only be:
    • host: The virtual battery reflect the host battery (if exists)
    • manual: In this mode, you can set the level and status battery values
  • battery getlevel
    Return the current battery amount of power. The value can only be between 0% and 100%.
    If the battery mode is "host", the returned value is the host value.
  • battery setlevel
    Set the current battery amount of power. The value can only be between 0% and 100%.
    Set the battery level force the "manual" mode: if the last mode was "host", then it's turned to "manual"
  • battery getstatus
    Return the current battery status. There are 4 possible status:
    • Discharging: The power supply is disconnected and the battery is discharging.
    • Charging: The power supply is connected and the battery is charging.
    • Full: The battery is full.
    • Unknown: Sometimes, the battery status cannot be established, it happens when there is no host battery.
  • battery setstatus
    Set the current battery status. There are 4 possible status:
    • Discharging: The power supply is disconnected and the battery is discharging.
    • Charging: The power supply is connected and the battery is charging.
    • Full: The battery is full.
    • Unknown: Sometimes, the battery status cannot be established, it happens when there is no host battery.

  • devices list
    List available Genymotion virtual devices and provides details like current states or IP address.
  • devices ping
    Send a ping message to check if virtual device if responding
  • devices refresh
    Refresh Genymotion virtual device list. Use it to keep the list up-to-date.
  • devices select
    Select the Genymotion virtual device you want to interact with.
  • devices show
    List available Genymotion virtual devices and provides details like current states or IP address

  • gps activate
    Activate the GPS sensor (if not already activated)
  • gps desactivate
    Desactivate the GPS sensor (if activated)
  • gps getlatitude
    Return the actual latitude (if GPS is activated AND already has a latitude) or 0
  • gps setlatitude
    Set latitude (and activate GPS if not allready activated)
  • gps getlongitude
    Return the actual longitude (if GPS is activated AND allready has a longitude) or 0
  • gps setlongitude
    Set longitude (and activate GPS if not allready activated)
  • gps getaltitude
    Return the actual altitude (if GPS is activated AND allready has a altitude) or 0
  • gps setaltitude
    Set altitude (and activate GPS if not allready activated)
  • gps getaccuracy
    Return the actual accuracy in meters (if GPS is activated AND allready has a accuracy) or 0
  • gps setaccuracy
    Set accuracy (and activate GPS if not allready activated)
  • gps getorientation
    Return the actual orientation in meters (if GPS is activated AND allready has a orientation) or 0
  • gps setorientation
    Set orientation (and activate GPS if not allready activated)

  • android version
    Return the Android version of the selected virtual device
  • build number
    Return the genymotion shell build number
  • help
    Prompt the help.
  • pause
    Pause execution (in number of seconds).
  • version
    Return GenyShell version.
  • exit or quit
    Close Genymotion Shell.

分享到:
评论

相关推荐

    Genymotion-ARM-Translation各Android版本集合-从4.x到9.0

    Genymotion-ARM-Translation 是Genymotion模拟器安装arm类型软件报错 This probably means that the app contains ARM native code and your Genymotion device cannot run ARM instructions.针对这个错误需要下载...

    genymotion-3.3.1.dmg MacOS端安卓模拟器

    Genymotion 是一个非常快速的 Android 模拟器,秒级开机关机速度,傻瓜式安装,易于使用,将复杂的技术隐藏于 VitualBox、HardWare OpenGL 等驱动引擎中,支持绝大部分的模拟器功能与感应器,甚至支持语音、NFC、...

    Genymotion3.0

    genymotion安卓模拟器其实不是普通的模拟器,严格来说,genymotion是虚拟机,被网传定义为模拟器,genymotion虚拟机希望能够给你带来最好的Android模拟体验,目前具备以下特性(更多特性正在开发中,敬请期待): ...

    Android开发必备:秒杀真机超快模拟器Genymotion介绍

    您可能感兴趣的文章:Android通过实现GridView的横向滚动实现仿京东秒杀效果Android实现京东秒杀界面Android 仿京东秒杀倒计时代码Android定时器和倒计时实现淘宝秒杀功能Android仿京东首页秒杀倒

    AndroidTips:Android开发中的一些技巧。Android开发总结。

    1.genymotion模拟器如何锁屏? 答:在模拟器的设置->安全->屏幕锁定->选择除<无>以外的其他选项。然后单击模拟器的电源按钮即可锁屏(或在命令行中输入adb shell keyevent 26原理和按电源键一样,模拟电源键点击...

    疯狂java实战演义源码-AndroidTips:https://github.com/cokuscz/AndroidTips.git

    1.genymotion模拟器如何锁屏? 答:在模拟器的设置-->安全-->屏幕锁定-->选择除<无>以外的其他选项。 然后点击模拟器的电源按钮即可锁屏(或在命令行中输入adb shell keyevent 26原理和按电源键一样,...

    UIAutomatorDemo:使用 UIAutomator 对 4 个小部件进行自动化测试

    安装 genymotion 模拟器 选择并打开 Google Nexus 10 - 4.4.4、API 19、2560X1600 模拟器,解锁屏幕 检查android目标(在命令行中运行下一个命令-android列表目标)-在我的情况下它是1、2、3、4、5、6、7 请在主页...

    Android插件

    CheckStyle-IDEA 是一个检查代码风格的插件,比如像命名约定,Javadoc,类设计等方面进行代码规范和风格的检查,你们可以遵从像Google Oracle 的Java 代码指南 ,当然也可以按照自己的规则来设置配置文件,从而有效...

    androidtraining-google_play_services

    支持库和 Google Play 服务将 Google Play 服务集成到您的应用程序中以使用地图服务。要求对于这部分,您需要在安装了 Google Play 服务的设备上运行。 如果您将在 Genymotion 模拟器中运行该应用程序,则必须安装 ...

    nanodegree_project4_builditbigger:Udacity Android Nanodegree课程的第四个项目

    在此项目中,您将创建一个具有多种风格的应用程序,该应用程序使用多个库和Google Could Endpoints。 完成的应用程序将包含四个模块。 一个提供笑话的Java库,一个为这些笑话服务的Google Could Endp

    android_course:android_course

    安卓开发课程## Hello world,项目结构,... ## 在 Android 中使用流。 ## 8 课,4 月 22 日 使用网络和服务器。 请求。 Parse.com。 ## 第课创建应用程序的密钥。 释放。 在 Google Play 上发布和推广。 通过应用获

    Flow-Android-client:连接并保留从Flow API检索到的数据的Android客户端

    为了使Google Play服务可用,我们需要安装ARM转换器和Google Apps的刷新映像,因为Genymotion VM上不提供这些服务。 经过测试的图像: Custom phone 5.1.0 - API 22 Google Nexus 6 - 5.1.0 - API 22 ARM翻译...

    FidReader:在 Globant > Disney 工作时用于培训目的的简单 Android RSS Feed 阅读器

    “设置开发环境(Android Studio、Java SDK、Git、Git 客户端、GitHub 公共存储库、模拟器和 Genymotion 设备)” 创建 Android Studio 项目并定义包名称 Android 核心组件:Activity 和生命周期 应用上下文 活动...

    bbuddy-acceptance-test

    Genymotion(或您喜欢的任何Android模拟器) 由于没有预先安装的模拟器,请安装模拟器,例如Google Galaxy Nexus-4.1.1-API 16-720 * 1280 Android Studio 请按照Android Studio的建议安装缺少的Android SDK 与iOS...

    adb1.0.26包含fastboot.exe

    从 emulator-5554 这个名字可以看出它是一个 Android 模拟器,而 10.129.164.6:5555 这种形为 <IP>:<Port> 的 serialNumber 一般是无线连接的设备或 Genymotion 等第三方 Android 模拟器。 常见异常输出: 没有...

Global site tag (gtag.js) - Google Analytics