📜 ⬆️ ⬇️

Helping a web developer: mobile device emulators

I think some of the web developers are faced with the task of creating websites and services for mobile platforms. And the problem arises at the moment when it is necessary to test your creation. And if to find this or that device is still not a problem, then testing on the maximum number of devices is quite difficult. And here they come to the aid - emulators. In this post I will discuss the issues of installing and running emulators of the following mobile devices, in order to launch the necessary service on them: Win Mobile, iPhone, BlackBerry, Android, Symbian ^ 3.

Windows mobile



Necessary software



')
Image installation


Images of virtual machines are installed from the Images5.0.msi file (for Windows Mobile 5.0). Installation is quick and easy. In the “Start \ Programs” menu, a folder with the labels “Microsoft Windows Mobile 5.0 MSFP Emulator Images” or “Windows Mobile 6 SDK” is created, depending on the selected OS version.

image

I will briefly describe the purpose of each label:

Device Emulator Manager is a launch manager that allows you to manage the work of running emulators. We will talk about this program below.

XXXXX - Coldboot - launch of a “clean” Windows Mobile image, the version with default settings, that is, the “bare” system.

XXXXX - Savestate - starting a virtual computer from a previously saved state.

The “Smartphone QVGA” version differs from the usual “Smartphone” in that the QVGA display resolution is 320x240 pixels, and the standard resolution for WM-smartphones is 176x220 pixels. Now manufacturers are mainly producing smartphones with a resolution of 320x240, so the QVGA mode is most relevant.

I also recommend that you look at the properties of the shortcuts for running the virtual machine.

A little bit about the launch


The emulator accepts the initial settings only as command line arguments, and if you run the DeviceEmulator.exe file independently (without parameters), only a list of valid arguments is displayed.

image

For example, the label "Pocket PC - Coldboot" calls the emulator with the following parameters:

C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe» pocketpc.nb0 /memsize 128 /skin Pocket_PC.xml /vmid {f1b1af09-969d-4035-8223-b800c75f451f} /s pocketpc.dess /p /funckey 193

So, everything is ready. We press for an example of "PocketPC - Coldboot" and in the future we will work with the Pocket PC image. Before us appeared a window with a virtual PDA, which can be used for various experiments. In the meantime, I suggest going to setting up an emulator.

Emulator setup


As it was already written above, the main parameters are passed to DeviceEmulator.exe as arguments, therefore opening the emulator settings (File / Settings) we will see that some properties cannot be changed (they are locked out of harm's way).

image

On the General tab, you can change the Host key and FuncKey fields, which play practically no role when using the emulator, so you can leave them in touch (we will clarify that these parameters affect the work with the keyboard). But the Shared Folder option is very useful and allows you to use a folder on your PC as a virtual memory card for the emulator. You can either select a directory from the list or enter the path manually. It should be noted that the entered address must exist, otherwise the emulator will generate an error.

All parameters from this tab can be set using command line parameters:

/ binfile - the full name of the file with the virtual machine image. For example: “C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe” “C:\Program Files\Windows Mobile 6 SDK\PocketPC\Deviceemulation\0419\PPC_RUS_GSM_VR.BIN”. If the emulator is launched from the folder with the image, then the full path to the file can be omitted.

/ memsize size - set the amount of virtual memory in size megabytes. For example / memsize 64

/ sharefolder directoryname - path to the shared folder. For example: / sharefolder “C: \ PPC_SD”

/ funckey key - install FuncKey. For example: / funckey 193

/ hostkey keyname — sets the Host key (“None”, “Left-Alt” or “Right-Alt”). For example: / hostkey Left-Alt

/ flash filename - allows you to set the “Flash memory file” field to emulate flash memory through a file. For example: / flash ppc_flash.bn

image

Next, go to the Display tab. Here you can either choose a ready Skin / Skin (appearance of a virtual PDA), or specify the resolution manually. Each skin is described in an XML file that is stored in a folder with images (or in separate folders). As for the Video mode (you can choose either Video or Skin), then the Screen width, Screen height and Color depth fields will most likely be zadizeyblen, since the screen parameters can be set via the command line, as mentioned above. Zoom 2x mode increases the size of the emulator display by 2 times, without changing the actual screen resolution of the virtual PDA. Always on top - always keep the emulator above the rest of the windows, Show tooltips - show tooltips. Orientation - turn the PDA to 0, 90, 180 or 270 degrees clockwise.

Emulator manager


We should also mention the Device Emulator Manager (DEM) program, which allows you to work with several images at once, turn them on / off, connect to the cradle, reboot, and so on.

image

The Refresh button is needed to manually update the state of virtual machines. This button must be pressed after starting / closing the emulator. Each image has its own number (ID), through which it is possible in DEM to work with a virtual PDA.

The menu item “File-> Restore Image” allows you to restore the image saved through “Save state and exit” (see above), the state of the virtual machine is saved in a file with the .dess extension.

If there is a tick next to the menu item “File-> No Security Prompts”, then when you start the emulator, you will not be prompted to connect the network adapter / peripherals, etc. This item corresponds to the command line parameter / nosecuritypromt

In the “Actions” menu there are various actions that can be performed with a virtual machine (the same menu opens when you right-click on an image ID):


image

In order for ActiveSync to recognize the connection of the virtual PDA, in its settings of the connection parameters there should be a tick “Allow connect. to next objects ”and the DMA option is selected.

You can work!

(Most of the material is taken from here )

iphone



There is no synchronization for this platform, as it allows you to run only the browser.
To run this emulator, we need Safari for Windows, version either 3 or 4 . Accordingly, depending on the safari version, the desired version of the emulator also swings: 3 or 4 . The difference lies in the version of WebKit, which renders the image.
After everything is downloaded, you must first install the safari, and then unzip the emulator in a separate folder. In case of 4, it is desirable to copy all the files from this folder.

C:\Program Files\Common Files\Apple\Apple Application Support

to the folder where the emulator was unzipped. We start the emulator and go to the address of the application.

Android



First, download the Android SDK . (Find Standalone emulator unfortunately did not work). After downloading, run the installation and see something like the following:

image

It offers us to download all the latest updates. You can close it safely and go to the Available packages, where we select the desired version of the platform.

image

Let me remind you, in terms of web rendering, the difference between 1.5 and 2.1 is huge.
Now we go to the Virtual device tab where we create the device of the version we need.

image

Profit!
For syncing, I used HTC Sync .

Blackberry



The thickest downloads are here. I had to deflate almost 150 meters, which is terrible. The SDK weighs another 300 meters. Epic. In addition, in order to download all this, you will first have to register, which generally does not fit into any gate. But from words to deeds.
First we download BlackBerry Email MDS . After that, download the emulator itself . Dependence model version of the OS can be viewed here .
Download and install. After that, first run the BlackBerry Email MDS, and wait until the new message stops in the console. After that we start the emulator and again profit.

Tulsa to synchronize download here .

Symbian ^ 3



Emulator installation


First we go to the downloads page where we need to download the following files:



After downloading everything you need to unpack into one folder.
When all this is done to run the emulator you will need to run the file:

% home_dir% \ epoc32 \ release \ winscw \ urel \ epoc.exe

It starts long, I would even say very long. In the first run, you will be required to enter your country and time. If the emulator does not start or crashes with errors, then this file should be run:

% home_dir% \ epoc32 \ release \ winscw \ udeb \ epoc.exe

Unfortunately, it works even slower, so please be patient =)

Network connection


But that's not all, since our task is to launch a web application. Go to the process of connecting to the Internet.
Here are two ways:



The first path (which I used). Download the tool from the project page and install it. The product is free and, according to symbian developers, stable.

Now we will create and configure the CommsDat file, which is responsible for connecting to the network.
In folder

%home_dir%\epoc32\winscw\c

there is an ethernetced.xml file that is responsible for the settings. A very important element in it is the area bounded by the tag. This is where the proxy connection settings are written, which is quite relevant.
Next, in the environment variables, add a new EPOCROOT variable, in which the path to the root folder where the files were unpacked is indicated. In addition, the following path should be added to the PATH:

%home_dir%\epoc32\tools

After that, in the console, run EnableLanConnection.cmd, which does the following:



The second path. Unfortunately, the second tool is not yet available separately, so you have to download all the PDTs. It is installed simultaneously with the PDT and sets the default ip for the device 192.168.0.1. You can configure it by running the following command in the console:

netsh interface ip set address TAP-Win32 static 192.168.0.77 255.255.255.0

Health check

To check that everything works, we launch the browser and try to go to the right address. When connecting for the first time, it is suggested to choose one of the access points:



We need the last - Ethernet with Daemon Dynamic IP.

UPD1

We also assign the Opera Mobile emulator and Opera Mini Simulator to useful emulators. Thank you pepelsbey and Akos .

Source: https://habr.com/ru/post/96453/


All Articles