Mobile/Build/Windows Mobile Build Instructions: Difference between revisions

Jump to navigation Jump to search
Line 12: Line 12:


'''Did we mention that things are changing frequently?'''
'''Did we mention that things are changing frequently?'''


===Big Picture===
===Big Picture===
Here is a big-picture view of the steps needed to prepare a new PC for debugging the Windows Mobile Fennec and/or a Windows Mobile ZULRunner application.
Here is a big-picture view of the steps needed to prepare a new PC for debugging the Windows Mobile Fennec and/or a Windows Mobile ZULRunner application.


* One-Time Setup, including:
* '''One-Time Setup''', including:
** Install Visual Studio 2008 Professional (VS9) or Visual Studio 2005 Professional (VS8)
** Install Visual Studio 2008 Professional (VS9) or Visual Studio 2005 Professional (VS8)
** Install Windows Mobile 6 Professional SDK
** Install Windows Mobile 6 Professional SDK
Line 23: Line 24:
** [Optional] Download and Install Latest Mercurial
** [Optional] Download and Install Latest Mercurial


* Download Sources and Patch Queue
* '''Prepare To Build'''
** Download (or update) Sources and Patch Queue
** Download and/or Create Your MOZCONFIG File


* Download and/or Create Your MOZCONFIG File
* '''Build'''


* Compile Everything
* '''Debugging'''
 
** Prepare for Debugging
* Prepare for Debugging
** Start Debugging
 
* Start Debugging


Still interested?  OK, let's get started.
Still interested?  OK, let's get started.
Line 79: Line 80:




==Downloading and Building==
==Prepare To Build==


These directions assume you have created a '''c:\mozilla-build''' directory,
These directions assume you have created a '''c:\mozilla-build''' directory,
Line 130: Line 131:




===CRUD - The Clone of Mozilla-Central Freezes===
====CRUD - The Clone of Mozilla-Central Freezes====


Several people have reported that the cloning of mozilla-central as described above freezes and does not complete.  
Several people have reported that the cloning of mozilla-central as described above freezes and does not complete.  
Line 171: Line 172:


Thanks go out to Benjamin Smedbergs for this solution - [http://benjamin.smedbergs.us/blog/2008-06-05/getting-mozilla-central-with-limited-bandwidth/ Original Blog Posting Here]
Thanks go out to Benjamin Smedbergs for this solution - [http://benjamin.smedbergs.us/blog/2008-06-05/getting-mozilla-central-with-limited-bandwidth/ Original Blog Posting Here]
===Updating The Sources And Patch Queue===
Run the batch file '''C:\mozilla-build\start-msvc8.bat''' (or '''C:\mozilla-build\start-msvc9.bat''')
    NOTE: This will setup and open a MingW32 command prompt.
          All further commands are to be run inside MingW32.
          This assumes you have a c:\hg\mozilla-central directory
$ '''cd /c/hg/mozilla-central'''
$ '''hg qpop -a'''
$ '''hg pull;hg update;'''
$ '''cd mobile'''
$ '''hg pull;hg update;'''
$ '''cd ,,/.hg/patches'''
$ '''hg pull;hg update;'''
$ '''cd ../..'''




Line 176: Line 201:


Building options are controlled by mozconfig, a master file within your top source directory (in our case, /c/hg/mozilla-central/mozconfig).  
Building options are controlled by mozconfig, a master file within your top source directory (in our case, /c/hg/mozilla-central/mozconfig).  
You need to create a MOZCONFIG file, since one is not included in the source code repositories.  There are four options for Windows Mobile 6 development:
  (1) Visual Studio 9 Debug Build
  (2) Visual Studio 9 Release Build
  (3) Visual Studio 8 Debug Build
  (4) Visual Studio 8 Release Build


====VS9 Debug Build MOZCONFIG====
====VS9 Debug Build MOZCONFIG====
Line 278: Line 311:
      
      
     ''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"''
     ''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"''


====VS8 Debug Build MOZCONFIG====
====VS8 Debug Build MOZCONFIG====
Line 334: Line 368:
      
      
     ''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"''
     ''ac_add_options --with-wince-sdk="c:/program files/windows mobile 6 sdk/pocketpc/include/armv4i"''


====VS8 Release Build MOZCONFIG====
====VS8 Release Build MOZCONFIG====
Line 385: Line 420:




==Build==


Now you can build xulrunner (and the mobile fennec code) using these commands:


===Building XULRunner and Mobile Fennec Code===
  $ '''cd /c/hg/mozilla-central'''
 
 
'''Now you can build xulrunner and the mobile fennec code using these commands:'''
 
   $ '''hg qpush -a'''
   $ '''hg qpush -a'''
    
    
   $ '''make -f client.mk build'''
   $ '''make -f client.mk build'''


==Notes After Building But Before Debugging==


===Copy MOZCE_SHUNT.DLL===
===Copy MOZCE_SHUNT.DLL To BIN===
For Visual Studio 2005 (VS8), you can find the shunt DLL at:
For Visual Studio 2005 (VS8), you can find the shunt DLL at:
  /c/hg/mozilla-central/build/wince/shunt/build/vs8/mozce_shunt.dll
  /c/hg/mozilla-central/build/wince/shunt/build/vs8/mozce_shunt.dll
Line 414: Line 448:
Both of these rather cryptic messages try to tell you that an executable file (EXE or DLL) depends upon a DLL, and that DLL could not be found.
Both of these rather cryptic messages try to tell you that an executable file (EXE or DLL) depends upon a DLL, and that DLL could not be found.


==Debugging==


===Debugging Fennec===
===Debugging Fennec===
Line 428: Line 464:




===Visual Studio 2005 / Visual Studio 8===
===Visual Studio 2005 / Visual Studio 8 Debugging===
Visual Studio 2005 (VS8) has the following issues when debugging:
Visual Studio 2005 (VS8) has the following issues when debugging:


Line 447: Line 483:




===Visual Studio 2008 / Visual Studio 9===
===Visual Studio 2008 / Visual Studio 9 Debugging===
Visual Studio 2008 (VS9) has the following issues when debugging:
Visual Studio 2008 (VS9) has the following issues when debugging:


Line 459: Line 495:




===Visual Studio Windows Mobile Emulator Images===
===Emulator Images===
To run / debug xulrunner and fennec, you will need to increase the amount of memory available to the WinMobile 6.1 Emulator Image in which you are running.
To run / debug xulrunner and fennec, you will need to increase the amount of memory available to the WinMobile 6.1 Emulator Image in which you are running.


Line 481: Line 517:




==Setting Up MyBrowser==
===On-Device Debugging===
Some devices ship with security settings turned on.  All devices need to have development certificates loaded onto them before debugging.
 
 
====Putting Development Certificates On Your Device====
To set the development certificates into your device, copy the file ''C:\Program Files\Windows Mobile 6 SDK\Tools\Security\SDK Development Certificates\Certs.cab'' onto your device.  Locate and run this CAB file using the device's File Explorer.  Once this CAB file has been installed into your device, the device will be able to run all of the Visual Studio devlopment tools.
 
 
====Enabling RAPI Commands On Your Device====
To allow all RAPI (Remote API function calls from the desktop to your tethered, or connected, device) function calls to succeed, you may need to run a command from a DOS box on your PC.  Run these commands once your device has the development certificates installed and you have your device connected to your PC:
 
  C:\> '''cd "C:\Program Files\Windows Mobile 6 SDK\Tools\Smartphone\RapiSecurity"'''
 
  C:\> '''RapiConfig.exe  /P /M RapiAllowed.xml'''
 
Instead of running the RapiConfig.exe program, you can copy a Certificate Provisioning File (.CPF) to your device, and run the .CPF file just like you ran the Certs.cab file.  Copy the file ''C:\Program Files\Windows Mobile 6 SDK\Tools\Smartphone\RapiSecurity\RapiAllow.cpf'' file onto your device.  Locate and run this .CPF file using the device's File Explorer.
 
 
====Security Powertoy====
Microsoft provides a Security Powertoy application which allows mere mortals to manipulate the security settings on a device from a semi-friendly GUI.
 
WARNING: The Security Powertoy has the ability to completely mess up your device.  Use this tool with extreme caution.
 
To use the Security Powertoy, run the "C:\Program Files\Windows Mobile 6 SDK\Tools\Security\Security Powertoy\SecCfgMgr.msi" installer.  Once the installer has finished, there will be a shortcut created in your PC's Start Menu named "Security Configuration Manager".
 
 
===Setting Up MyBrowser===


A simple XULRunner application, MyBrowser, is used to test the XULRunner code.
A simple XULRunner application, MyBrowser, is used to test the XULRunner code.
Line 504: Line 566:




==Setting Up For Debugging MyBrowser==
===Setting Up Debugging of MyBrowser===


You can debug the MyBrowser XULapp from within Visual Studio by using the WinCE shunt Visual Studio Project, and adjusting the deployment device and executable to be run.
You can debug the MyBrowser XULapp from within Visual Studio by using the WinCE shunt Visual Studio Project, and adjusting the deployment device and executable to be run.
Line 533: Line 595:




==Debugging MyBrowser==
===Actual Debugging===


You are now ready to begin debugging your XULRunner build.
You are now ready to begin debugging your XULRunner build.
Line 539: Line 601:
  1. From the Visual Studio 2005 '''Build''' menu, select the '''Deploy Solution''' menu item
  1. From the Visual Studio 2005 '''Build''' menu, select the '''Deploy Solution''' menu item
   
   
  2. Wait for the Windows Mobile 6 Standard Emulator has start
  2. Wait for your chosen Emulator to start
   
   
  3. In the Emulator's '''File''' menu, select the '''Configure...''' menu item
  3. In the Emulator's '''File''' menu, select the '''Configure...''' menu item
130

edits

Navigation menu