Mobile/Fennec/Android/Emulator: Difference between revisions

From MozillaWiki
< Mobile‎ | Fennec‎ | Android
Jump to navigation Jump to search
(Created page with "== Running Fennec in Android Emulator == === Prerequisites === As Fennec requires an ARMv7 architecture, we need an AVD (Android Virtual Device) that has the ''armeabi-v7'' CPU...")
 
 
(13 intermediate revisions by 6 users not shown)
Line 3: Line 3:
=== Prerequisites ===
=== Prerequisites ===


As Fennec requires an ARMv7 architecture, we need an AVD (Android Virtual Device) that has the ''armeabi-v7'' CPU ABI. Such a device definition and images are only included in the newest SDK (at least revision 15). To ensure you have all the required software, first install an Android SDK if you don't have one yet, then open your android SDK manager (tools/android) and perform the following steps:
As Fennec requires an ARMv7 architecture, we need an AVD (Android Virtual Device) that has the ''armeabi-v7'' CPU ABI and GPU emulation. Such a device definition and images are only included in the newest SDK (at least revision 17 with Platform API 15r3). To ensure you have all the required software:


* Check if any updates to your SDK are available and install them
# install an [http://developer.android.com/sdk/index.html Android SDK] if you don't have one yet.  (On OSX, ''install'' is just "download and unzip it somewhere").
* In your packages list, you should then have an entry "Android 4.0 (API 14)". Check this category and install all packages.
# open your android SDK manager (using <tt>tools/android</tt>) and perform the following steps:
 
* Check 'Android SDK Tools' and 'Android SDK Platform-tools' are installed and up to date
* In your packages list, you should then have an entry "Android 4.1 (API 16)". Check this category and install all packages.
* Read about using the [http://developer.android.com/guide/developing/devices/emulator.html Android emulator] and how to [http://developer.android.com/guide/developing/tools/emulator.html launch] the emulator.
 
[[File:android-sdk-manager.png]]


=== Creating the AVD ===
=== Creating the AVD ===


Open the Android Virtual Device Manager (in the SDK Manager under tools), create a new entry and make sure you use "Android 4.0 (API Level 14)" as target. You can attach a virtual SD card as well and change display settings if you like. In the hardware list further down you can add or remove hardware support, e.g. you can simulate not having a hardware keyboard by adding "Keyboard support" to the list and changing that entry to "No" then.
[[File:Avd-manage-menu_.png]]
 
Open the Android Virtual Device Manager (in the SDK Manager under <tt>tools > Manage AVDs</tt>), create a new entry and make sure you use "Android 4.1 (API Level 16)" as target. You can attach a virtual SD card as well and change display settings if you like. You can also set the device's RAM, which would help improve performance (recommended amount: 1024MB).
 
[[File:Avd-emulator.png]]
 
In the hardware list further down you can add or remove hardware support, e.g. you can simulate not having a hardware keyboard by adding "Keyboard support" to the list and changing that entry to "No" then. In order to run Fennec, you must select "GPU emulation" from the hardware options and set the value to "yes".
 
[[File:Avd-hwoptions.png]]
 
[[File:Avd-gpuemulation.png]]


=== Starting the AVD ===
=== Starting the AVD ===


Select the AVD from the list and hit "Start". Booting up takes a while, and the device is very slow (especially with larger resolutions).
Once you have created the AVD, you can select the AVD from the list and hit "Start". Booting up takes a while, and the device is very slow (especially with larger resolutions).
 
=== Installing Fennec ===
 
Once you have the emulator running, you can access it through [http://developer.android.com/tools/help/adb.html adb] by enabling USB debugging in Settings > Developer options. You should see it listed as a device:
$ adb devices
List of devices attached
emulator-5554 device
 
You can download a Fennec .apk to your desktop and install it by running:
 
$ adb install <path to fennec apk>
 
See [[Mobile/Platforms/Android]] for direct links to releases of Fennec hosted on our FTP server.

Latest revision as of 14:57, 13 September 2012

Running Fennec in Android Emulator

Prerequisites

As Fennec requires an ARMv7 architecture, we need an AVD (Android Virtual Device) that has the armeabi-v7 CPU ABI and GPU emulation. Such a device definition and images are only included in the newest SDK (at least revision 17 with Platform API 15r3). To ensure you have all the required software:

  1. install an Android SDK if you don't have one yet. (On OSX, install is just "download and unzip it somewhere").
  2. open your android SDK manager (using tools/android) and perform the following steps:
  • Check 'Android SDK Tools' and 'Android SDK Platform-tools' are installed and up to date
  • In your packages list, you should then have an entry "Android 4.1 (API 16)". Check this category and install all packages.
  • Read about using the Android emulator and how to launch the emulator.

Android-sdk-manager.png

Creating the AVD

Avd-manage-menu .png

Open the Android Virtual Device Manager (in the SDK Manager under tools > Manage AVDs), create a new entry and make sure you use "Android 4.1 (API Level 16)" as target. You can attach a virtual SD card as well and change display settings if you like. You can also set the device's RAM, which would help improve performance (recommended amount: 1024MB).

Avd-emulator.png

In the hardware list further down you can add or remove hardware support, e.g. you can simulate not having a hardware keyboard by adding "Keyboard support" to the list and changing that entry to "No" then. In order to run Fennec, you must select "GPU emulation" from the hardware options and set the value to "yes".

Avd-hwoptions.png

Avd-gpuemulation.png

Starting the AVD

Once you have created the AVD, you can select the AVD from the list and hit "Start". Booting up takes a while, and the device is very slow (especially with larger resolutions).

Installing Fennec

Once you have the emulator running, you can access it through adb by enabling USB debugging in Settings > Developer options. You should see it listed as a device:

$ adb devices
List of devices attached 
emulator-5554	device

You can download a Fennec .apk to your desktop and install it by running:

$ adb install <path to fennec apk>

See Mobile/Platforms/Android for direct links to releases of Fennec hosted on our FTP server.