Ever had a problem where your application was running fine on the emulator, but failed to run on hardware? Ran an application on the emulator, but the application exited, without showing any reason? Or perhaps, you expected to see the emulator logs in the debugger window, but they never appeared?
That’s because of rather aggressive approach taken by the S60 SDK installer in terms of disabling emulator diagnostics (most annoyingly, platform security violations, which go unchecked on the emulator by default) and results in unexpected behavior from applications when run on real hardware.
If you already have the S60 SDK installed, its worth checking if the diagnostics are enabled and even if you don’t want them, at least know what options affects which bits of diagnostics.
Before we begin, its worth nothing that the settings discussed below can be enabled through both the emulator GUI (Tools -> Preferences -> C++ Debug/Platform Security) and by modifying the
epoc.ini file (
C++ Debug Settings
- Log to Debugger – Enables logging debug output from application and emulator, i.e.
RDebug::Printf/RTestto Carbide.c++ debug console window. Set
LogToDebugger 1to enable or
LogToDebugger 0to disable using
epoc.ini. Personally, I leave it disabled in favor of
epocwind.outlogging (see below).
- Just in Time – Enables automatically invoking the debugger if a panic/assertion is hit. Set
JustInTime queryto enable or
JustInTime 0to disable using
- Enable epocwind.out Logging – Writes the debug logs (see Log to Debugger) to
epocwind.out (%temp%epocwind.out). Invaluable, since likes of panic and platform security exceptions are logged if enabled. Set
LogToFile 1to enable and
LogToFile 0to disable using
Platform Security Settings
- Panic|Leave on Insecure API calls – Enables process isolation, which prevents invoking operations on a thread in a different process that’s deemed insecure. For example, calling
RThread::Killto terminate another arbitrary process without appropriate platform security capability. Set
PlatSecProcessIsolation ONto enable or
PlatSecProcessIsolation OFFto disable using
- Perform capability checks – Enables platform security capability checking. Set
PlatSecEnforcement ONto enable and
PlatSecEnforcement OFFto disable using
epoc.ini. By default, this is disabled which is baffling, since platform security is one of the main features of Symbian OS 9.1 and above and its easy to fall into issues like this
Starting the Emulator Faster
The S60 emulator start-up time has always been a pain in the neck for developers. Thankfully, Nokia has addressed this with the release of S60 3.2 SDK and there’s a handy option to boot the emulator up faster. This is done by starting up a minimal set of application servers during start-up, dramatically increasing boot up. A nice side effect is the cache penalty seems to be significantly less and re-starting the emulator after the initial boot is super fast! To configure the emulator start up mode, boot up the emulator, go to Tools -> Preferences -> General Settings -> Emulator Start Up Mode -> Start minimal set of services. You can always revert back to the full set of services startup mode, if you find working with minimal boot is troublesome by choosing the Start all services option.
Some of the settings described above is described in detail in Where’s my console output? and the epoc.ini reference documentation in Symbian Developer Library (Symbian OS Tools And Utilities » Emulator » Emulator reference » Emulator configuration file: epoc.ini).