Development:Using Custom Profiles

From Camino Wiki
Jump to: navigation, search

When developing, debugging certain issues, or testing, you may find it helpful to run Camino with a custom profile, either to facilitate testing/debugging specific scenarios or to simply allow you to continue running your daily-use Camino while working. There are several methods available that allow you to launch another Camino at the same time as your daily-use Camino and/or protect your daily-use profile from development builds. Some methods may be more useful in certain situations than others.

N.B Note that none of these methods currently handle the org.mozilla.camino.plist, which stores settings related to our Cocoa UI; both builds will read the file into memory (and write to it occasionally), and the last build to quit will win and stomp other changes written to the file previously.

Contents

Troubleshoot Camino

A quick and easy way to test your changes without affecting your daily-use profile (or getting the dreaded "Another copy of Camino is already running" alert) is to use Troubleshoot Camino. Simply drag the built Camino application (from $objdir/camino/build/Debug/ or $objdir/dist/) to Troubleshoot Camino and you’re off.

Or, you can launch on Troubleshoot Camino like a regular application, and it will show an Open dialogue and let you choose a copy of Camino to launch; the tool will also remember the path to the last Camino you selected, making a second run require fewer clicks.

Note that Troubleshoot Camino always creates a temporary fresh profile, so if you need to persist any profile data, you will need to use another method.

Xcode

If you work mostly in Xcode, you can set the same environment variable that Troubleshoot Camino uses; then, any time you launch your (debug) Camino via Xcode, it will use profile location you’ve specified.

  1. From Xcode’s Project menu, choose “Edit Active Executable ‘CaminoApp’”
  2. In the Arguments tab, click the “+” button underneath the ”Variables to be set in the environment” table.
  3. In the “Name” column, type CAMINO_PROFILE_DIR, and in the “Value” column, provide the path to the location where you would like to store the profile for your development build.
  4. To run, click “Build & Go” in the toolbar.

Terminal

Environment variable

In the Terminal, you can set the same environment variable that Troubleshoot Camino uses:

export CAMINO_PROFILE_DIR="AbsolutePathToDesiredProfileFolder"; open /path/to/Camino.app

If you simply export the variable, any future launch of Camino from that terminal will use the specified profile location.

Command-line argument

Camino also supports the -profile command-line argument. This option is useful for running Gecko tests, e.g. Mochitest, and also for localization testing and debugging with gdb.

To use this method, use the full path to the Camino binary followed by the -profile argument with the full path to the desired profile location:

/path/to/Camino.app/Contents/MacOS/Camino -profile /full/path/to/desired/profile/location

gdb example:

gdb /path/to/Camino.app/Contents/MacOS/Camino
break MainController.mm:950
run -profile /full/path/to/desired/profile/location

Info.plist

Somewhat similar to the Xcode method above, you can set a custom profile by changing the value of the mozProfileDir key in your Camino build’s Info.plist. Specify a custom name (e.g., CaminoDebug) and Camino will use ~/Library/Application Support/CustomName for the profile when launched.

N.B. Because the Info.plist is regenerated periodically (every time Camino is rebuilt following a pull of new Camino code from the repository, every time Camino is rebuilt following a Gecko build ID change, and any time there are changes made to the Info.plist itself), the above change will have to be repeated often.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox