1

I'm also interested in other Symbian SDKs that allow to set their emulator's IMEI.

wheleph
  • 7,974
  • 7
  • 40
  • 57

3 Answers3

1

My general approach to these kinds of things is do it in software.

  1. Put the IMEI fetching code into one globally-accessible function, and only use this function for IMEI fetching.
  2. #ifdef __WINS__ can be used in C++ code to selectively compile in the hard-coded IMEI you want to return in the emulator. In Java, you can probably tell you are in the emulator by other means (eg if the IMEI returned is a fixed weird value in the emulator), and act accordingly.
  3. You can go one step further and have a dynamic IMEI. Once you do that, you will find that testing your code with different IMEIs becomes much easier.
1

Emulator has hardcoded IMEI of '000000000000000'. Replace what with whatever you want to use and continue running your code.

Symbian C++:

    TPlpVariantMachineId imei;
    PlpVariant::GetMachineIdL(imei); 
    imei.Copy(_L("123456789012345"));

Python for S60 (PyS60):

    import sysinfo
    my_imei = sysinfo.imei()
    my_imei = u"123456789012345"
JOM
  • 8,139
  • 6
  • 78
  • 111
  • What configuration files I need to change or API to call to do that? – wheleph May 27 '09 at 11:31
  • 1
    No config files, the normal APIs. It's just the way emulator works out-of-box: using "normal" IMEI request function call, you get real IMEI in real device, but zeros in emulator. I favour PyS60 nowadays for practical reasons, there you'd do: import sysinfo sysinfo.imei() ...but original question mentions C++: #include TPlpVariantMachineId imei; PlpVariant::GetMachineIdL(imei); In your code running in emulator just replace the received IMEI with whatever and continue. Got to do it by yourself for each and every app. No generic once-for-all solution. – JOM May 28 '09 at 06:35
  • As far as I understand you suggest the following code: TPlpVariantMachineId imei; PlpVariant::GetMachineIdL(imei); imei.Copy(_L("123456789012345")); Please, add it to your answer to be formatted properly. – wheleph May 28 '09 at 10:22
0

I have never actually tried that but here's my best guess:

The emulator doesn't have a proper telephony implementation unless:

  • you link it to an actual phone over infrared/usb/serial. In which case the emulator telephony component will need configuration to use AT commands to pilot the phone (even if the phone isn't a Symbian phone). This allows you to make phone calls, send and receive SMS/MMS but certainly not change the IMEI.

  • you use the SIMTSY module. This is a component that uses configuration files to simulate telephony events. It can pretend to send SMS/MMS, pretend you are receiving a phone call...none of that actually creates any kind of network traffic, you understand. I assume the IMEI is in the configuration file but I don't expect you can properly change it without restarting the emulator. I have never seen SIMTSY used outside of Symbian itself so I don't know whether it is available to third-party developer. It should be open-sourced with the rest of the operating system within the next 2 years, though.

There is also the possibility that the way the SDK itself was built disabled most of the telephony framework for the emulator, using build-time macro. You should check http://forum.nokia.com

michael aubert
  • 6,836
  • 1
  • 16
  • 32