/
simulator.txt
131 lines (95 loc) · 6.65 KB
/
simulator.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Using RhoSimulator
RhoSimulator allows to [run](#run-application-in-rhosimulator) Rhodes applications without lengthy build process and to [debug](#debugging-with-rhostudio) them in [RhoStudio](../rhostudio.tutorial). Currently RhoSimulator works on <b>Windows</b> only.
## Install RhoSimulator
If you have [Rhodes gem](install#rhodes-gem), then RhoSimulator is installed already.
(Note: If you're going to use RhoSimulator from rhodes-3.1.0 gem on Mac, you need to put missing Qt libraries
(QtDBus.framework and QtXml.framework) from [RhoSimulator31Mac_fix.zip](http://rhosimulator.s3.amazonaws.com/RhoSimulator31Mac_fix.zip)
to 'platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks' folder within rhodes SDK home directory,
e.g. '/Library/Ruby/Gems/1.8/gems/rhodes-3.1.0/')
If you would like to run RhoSimulator without Rhodes gem, download [Windows](http://rhosimulator.s3.amazonaws.com/RhoSimulator.zip) or
[Mac OS X](http://rhosimulator.s3.amazonaws.com/RhoSimulatorMac.zip) version, unzip and specify path to `rhosimulator.exe` or `RhoSimulator.app` respectively at `rhodes/rhobuild.yml`:
env:
paths:
rhosimulator: <RhoSimulator folder>
Alternatively you may [build](#build-rhosimulator) your own customized version of RhoSimulator as described [below](#build-rhosimulator).
## Run application in RhoSimulator
To run application in RhoSimulator just run in rhodes or application folder:
#run RhoSimulator to simulate specific platform:
rake run:android:rhosimulator
rake run:iphone:rhosimulator
#bbver from build.yml will be used as System.get_property('os_version')
rake run:bb:rhosimulator
rake run:wm:rhosimulator
rake run:wp:rhosimulator
#run RhoSimulator to simulate 'UNKNOWN' platform:
rake run:win32:rhosimulator
If you modified Rhodes application sources, just press 'Refresh' in RhoSimulator to reload application, i.e. generally no RhoSimulator restart is required.
The restart of RhoSimulator is required only if a model was added/modified or some code was added to the AppApplication class.
## Debugging with RhoStudio
### Prerequisites
* Install [RhoStudio](../rhostudio.tutorial)
* Install [RhoSimulator](#install-rhosimulator)
* Ensure your application is configured properly and successfully [runs in RhoSimulator](#run-application-in-rhosimulator) (from command line as described above)
### Starting debug session in RhoStudio
* Select Run » Debug Configurations... from top menu
* Find 'Rhodes Application' section on the left and add new (or modify existing) configuration
* On 'Common setting' tab select a project by clicking 'Browse...' button next to 'Project name:'
* Select 'Rho simulator' as the platform
* Click 'Apply' and then 'Debug'
### Debug capabilities
In present version of RhoStudio you may:
* Set breakpoints in Ruby code (.rb files)
* Watch variable values (global, local, class and instance) - currently auto-watch list is displayed in Expressions window
* View application log in Console window
## Build RhoSimulator
If you use custom native extensions, then running and debugging your applications in RhoSimulator requires a custom build.
Follow these instructions to build your own customized version of RhoSimulator.
### Preliminary steps
* Currently only <b>Visual Studio 2005 Service Pack 1</b> is supported
* Follow [Build for Windows - Prerequisites](build#build-for-windows), but do not install the Rhodes gem since you're going to use Rhodes SDK source.
* Get the `rhodes` source (if haven't done it already) as described [here](build#setup-rhodes-source-code). Don't forget to add the `bin` folder to your path, run `rhodes-setup` and update Rhodes SDK path in `build.yml` at your application root folder.
* First build the Qt libraries for VS 2005:
* Download the Qt source:
* Go to [http://qt.nokia.com/downloads](http://qt.nokia.com/downloads)
* Jump to `Qt libraries`
* Download the [source code as a zip](http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip) (236 MB)
* Extract the downloaded archive, e.g. into `C:\Qt\4.7.3-msvc2005`
* Prepare to build the OpenSSL library:
* Download [v0.9 source code](http://www.openssl.org/source/openssl-0.9.8r.tar.gz) from [www.openssl.org](http://www.openssl.org/) and extract the downloaded archive, e.g. into `C:\Qt\openssl-0.9.8r`
* Install Perl interpreter (if it's not installed yet), e.g. [ActiveState Perl](http://www.activestate.com/activeperl)
* Open Control Panel » System » Advanced system settings » Environment Variables and then:
* Create new system variable `QTDIR` = `C:\Qt\4.7.3-msvc2005`
* Add to the `PATH` variable: `C:\Qt\4.7.3-msvc2005\bin;C:\Qt\openssl-0.9.8r\bin` (it doesn't matter that `C:\Qt\openssl-0.9.8r\bin` folder does not exist yet)
* Either close all command prompts and Visual Studio instances, or reboot the computer so the new settings take effect.
* Open Visual Studio 2005 Command Prompt. This is accomplished using Start » All Programs » Microsoft Visual Studio 2005 » Visual Studio Tools » Visual Studio 2005 Command Prompt. Run in Visual Studio 2005 Command Prompt:
> vcvarsall.bat x86
> C:
* To build OpenSSL library run in the same command prompt:
> cd \Qt\openssl-0.9.8r
> perl Configure VC-WIN32 --prefix=C:/Qt/openssl-0.9.8r
> ms\do_masm
> nmake -f ms\ntdll.mak
> nmake -f ms\ntdll.mak install
> nmake -f ms\ntdll.mak clean
* To build Qt library run in the same command prompt:
> cd \Qt\4.7.3-msvc2005
> configure -opensource -platform win32-msvc2005
-nomake examples -nomake demos -nomake docs
-qt-libpng -qt-libjpeg -qt-libtiff -qt-gif -qt-libmng
-openssl-linked -I C:/Qt/openssl-0.9.8r/include
-L C:/Qt/openssl-0.9.8r/lib
> nmake
> nmake clean
Be aware that it will take a while to build the Qt libraries from sources (maybe few hours or so). Particularly the `configure` command may run for a few minutes, and the `nmake` command may run for a few hours.
* After the build process is completed exit Visual Studio 2005 Command Prompt
### Build with rake command:
rake build:win32:rhosimulator
To run Rhodes applications in custom built RhoSimulator, please ensure that no `env:` » `paths:` » `rhosimulator:` line is present at your `rhobuild.yml` (if present, remove that line).
### Build in Visual Studio 2005:
* Open the solution:
`C:\Rhomobile\rhodes\platform\wm\rhodes\rhodes.vcproj`
* Build solution for the configuration `SimulatorRelease|Win32`
* Specify the path to custom built RhoSimulator at `rhobuild.yml`:
env:
paths:
rhosimulator: platform/wm/bin/Win32/rhodes/SimulatorRelease