aboutsummaryrefslogtreecommitdiff
path: root/files/de/mozilla/add-ons/sdk/tools/jpm/index.html
blob: 86e6a82aa344ea2473875b68185137427a601389 (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
---
title: jpm
slug: Mozilla/Add-ons/SDK/Tools/jpm
translation_of: Archive/Add-ons/Add-on_SDK/Tools/jpm
---
<div class="note">
<p>Sie können <code>jpm</code> ab Firefox 38 verwenden.</p>

<p>Dieser Artikel bezieht sich auf <code>jpm</code>.</p>
</div>

<p><span class="seoSummary">Der Node-basierte Ersatz für <code><a href="/de/Add-ons/SDK/Tools/cfx">cfx</a></code>, erlaubt das Testen, Starten und Paketieren von Add-Ons.</span></p>

<p>Schauen Sie sich das <a href="/de/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29"><code>jpm</code>-Tutorial</a> als Einführung an.</p>

<p><code>jpm</code> wird folgendermaßen verwendet:</p>

<pre class="brush: bash">jpm [command] [options]
</pre>

<p><code>jpm</code> unterstützt die folgenden globalen Optionen:</p>

<pre class="brush: bash">-h, --help        - Zeigt eine Hilfsnachricht
-V, --version     - Anzeigen der JPM Versionsnummer
</pre>

<h2 id="Installation">Installation</h2>

<p><code>jpm</code> wird über den Node Package Manager (<code><a class="external external-icon" href="https://www.npmjs.org/package/jpm">npm</a></code>) installiert. <code>npm</code> ist im Installer von Node.js enthalten, welchen Sie auf <a class="external external-icon" href="http://nodejs.org/">nodejs.org</a> finden.</p>

<p>Nachdem Sie <code>npm</code> installiert haben, können Sie <code>jpm</code> wie jedes andere <code>npm</code>-Paket installieren:</p>

<pre class="brush: bash">npm install jpm -g</pre>

<p>Abhängig von ihren Einstellungen müssen Sie den Befehl möglicherweise mit Adminrechten ausführen:</p>

<pre class="brush: bash">sudo npm install jpm -g</pre>

<p>Tippen Sie folgendes in die Eingabeaufforderung:</p>

<pre class="brush: bash">jpm</pre>

<p>Es sollte sich eine Zusammenfassung der <code>jpm</code>-Kommandos öffnen. Im Gegensatz zu <code>cfx</code> ist <code>jpm</code> in jeder Eingabeaufforderung verwendbar, solange Sie es mit der Option <code>-g</code> installiert haben.</p>

<h3 id="Probleme">Probleme?</h3>

<p>Falls Sie die Zusammenfassung nicht verstehen, fragen Sie nach Hilfe. SDK-Nutzer und Teammitglieder des Projekts diskutieren über Probleme und Vorschläge in der  <a class="external external-icon" href="http://groups.google.com/group/mozilla-labs-jetpack/topics">Projekt- Mailingliste</a>. Andere könnten das selbe Problem wie Sie gehabt haben, also suchen Sie bitte zuerst im Listenarchiv. Sie können mit anderen SDK-Nutzern im Kanal <a class="external external-icon" href="http://mibbit.com/?channel=%23jetpack&amp;server=irc.mozilla.org">#jetpack</a> in <a class="external external-icon" href="http://irc.mozilla.org/">Mozillas IRC-Netzwerk</a> chatten.</p>

<h2 id="Command_reference">Command reference</h2>

<p>There are six jpm commands:</p>

<table class="fullwidth-table standard-table">
 <tbody>
  <tr>
   <td style="width: 20%;"><a href="/en-US/Add-ons/SDK/Tools/jpm#jpm_init"><code>jpm init</code></a></td>
   <td>Create a skeleton add-on as a starting point for your own add-on.</td>
  </tr>
  <tr>
   <td><a href="/en-US/Add-ons/SDK/Tools/jpm#jpm_run"><code>jpm run</code></a></td>
   <td>Launch an instance of Firefox with your add-on installed.</td>
  </tr>
  <tr>
   <td><a href="/en-US/Add-ons/SDK/Tools/jpm#jpm_test"><code>jpm test</code></a></td>
   <td>Runs your add-on's unit tests.</td>
  </tr>
  <tr>
   <td><a href="/en-US/Add-ons/SDK/Tools/jpm#jpm_xpi"><code>jpm xpi</code></a></td>
   <td>Package your add-on as an <a href="https://developer.mozilla.org/en/XPI">XPI</a> file, which is the install file format for Firefox add-ons.</td>
  </tr>
  <tr>
   <td><a href="/en-US/Add-ons/SDK/Tools/jpm#jpm_post"><code>jpm post</code></a></td>
   <td>Package your add-on as an <a href="https://developer.mozilla.org/en/XPI">XPI</a> file, then post it to some url.</td>
  </tr>
  <tr>
   <td><a href="/en-US/Add-ons/SDK/Tools/jpm#jpm_watchpost"><code>jpm watchpost</code></a></td>
   <td>Package your add-on as an <a href="https://developer.mozilla.org/en/XPI">XPI</a> file whenever there is a file changed, and post that to some url.</td>
  </tr>
 </tbody>
</table>

<h3 id="jpm_init">jpm init</h3>

<p>This command initializes a new add-on from scratch.</p>

<p>Create a new directory, change into it, and run <code>jpm init</code>.</p>

<pre class="brush: bash">mkdir my-addon
cd my-addon
jpm init</pre>

<p>You'll then be asked to supply some information about your add-on: this will be used to create your add-on's <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json">package.json</a> file.</p>

<ul>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#title">title</a></li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#name">name</a>: this defaults to the name of the directory in which you are running <code>jpm init</code>. Unless an <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#id"><code>id</code></a> field is present in package.json, jpm will prepend "@" to <code>name</code> and use the result as the <a href="https://developer.mozilla.org/en-US/Add-ons/Install_Manifests#id"><code>id</code> field in the add-on's install manifest</a>.</li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#version">version</a></li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#description">description</a></li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#main">entry point</a> (which maps to "main" in package.json)</li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#author">author</a></li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#engines">engines</a> (supported applications)</li>
 <li><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#license">license</a></li>
</ul>

<p>Most of these fields have a default, which is shown in brackets after the question. If you just press Enter, your add-on will get the default value.</p>

<p>Once you've supplied a value or accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to accept it.</p>

<p>Then jpm will create an skeleton add-on, as a starting point for your own add-on development, with the following file structure:</p>

<ul class="directory-tree">
 <li>my-addon
  <ul>
   <li>index.js</li>
   <li>package.json</li>
   <li>test
    <ul>
     <li>test-index.js</li>
    </ul>
   </li>
  </ul>
 </li>
</ul>

<h3 id="jpm_run">jpm run</h3>

<p>This command runs a new instance of Firefox with the add-on installed:</p>

<pre class="brush: bash">jpm run</pre>

<p><code>jpm run</code> accepts the following options:</p>

<table class="fullwidth-table standard-table">
 <tbody>
  <tr>
   <td style="width: 30%;"><code>-b --binary BINARY</code></td>
   <td>
    <p>Use the version of Firefox specified in BINARY. BINARY may be specified as a full path or as a path relative to the current directory.</p>

    <pre class="brush: bash">
jpm run -b /path/to/Firefox/Nightly</pre>
    See <a href="/en-US/Add-ons/SDK/Tools/jpm#Selecting_a_browser_version">Selecting a browser version</a>.</td>
  </tr>
  <tr>
   <td><code>--binary-args CMDARGS</code></td>
   <td>
    <p>Pass <a href="/en-US/docs/Mozilla/Command_Line_Options">extra arguments</a> to Firefox.</p>

    <p>For example, to pass the <code>-jsconsole</code> argument to Firefox, which will launch the <a href="/en-US/docs/Tools/Browser_Console">Browser Console</a>, try the following:</p>

    <pre class="brush: bash">
jpm run --binary-args -jsconsole</pre>

    <p>To pass multiple arguments, or arguments containing spaces, quote them:</p>

    <pre class="brush: bash">
jpm run --binary-args '-url mzl.la -jsconsole'</pre>
   </td>
  </tr>
  <tr>
   <td><code>--debug</code></td>
   <td>Run the <a href="/en-US/Add-ons/Add-on_Debugger">add-on debugger</a> attached to the add-on.</td>
  </tr>
  <tr>
   <td><code>-o --overload PATH</code></td>
   <td>
    <p>Rather than use the SDK modules built into Firefox, use the modules found at PATH. If <code>-o</code> is specified and PATH is omitted, jpm will look for the JETPACK_ROOT environment variable and use its value as the path.</p>

    <p>See <a href="/en-US/Add-ons/SDK/Tools/jpm#Overloading_the_built-in_modules">Overloading the built-in modules</a> for more information.</p>
   </td>
  </tr>
  <tr>
   <td><code>-p --profile=<code> PROFILE</code></code></td>
   <td>
    <p>By default, jpm uses a clean temporary Firefox <a href="http://support.mozilla.com/en-US/kb/profiles">profile</a> each time you call jpm run. Use the <code>--profile</code> option to instruct jpm to launch Firefox with an existing profile.</p>

    <p>The PROFILE value may be a profile name or the path to the profile.</p>

    <p>See <a href="/en-US/Add-ons/SDK/Tools/jpm#Using_profiles">Using profiles</a> for more information.</p>
   </td>
  </tr>
  <tr>
   <td><code>-v --verbose</code></td>
   <td>Verbose operation.</td>
  </tr>
  <tr>
   <td><code>--no-copy</code></td>
   <td>
    <div class="warning">Use with caution because <code>jpm run|test</code> changes many preferences, never use with your main profile.</div>

    <div class="note">This only applies when <code>--profile</code> is used.</div>
    Disables the copying of the profile used, which allows one to reuse a profile.</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h3 id="jpm_test">jpm test</h3>

<p>Use this command to run an add-on's unit tests. It will:</p>

<ul>
 <li>look for a directory called "test" under the add-on's root</li>
 <li>open every file in there whose name starts with "test-" (note the hyphen after "test" in the filename. <code>jpm test</code> will include a file called "test-myCode.js", but will exclude files called "test_myCode.js" or "testMyCode.js")</li>
 <li>call every function exported from that file whose name starts with "test"</li>
</ul>

<pre class="brush: bash">jpm test
</pre>

<p>See the <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Unit_testing">tutorial on unit testing</a> and the <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/test_assert">reference documentation for the <code>assert</code> module</a> for more details on this.</p>

<p><code>jpm test</code> accepts the following options:</p>

<table class="fullwidth-table standard-table">
 <tbody>
  <tr>
   <td><code>-b --binary BINARY</code></td>
   <td>
    <p>Use the version of Firefox specified in BINARY. BINARY may be specified as a full path or as a path relative to the current directory.</p>

    <pre class="brush: bash">
jpm test -b /path/to/Firefox/Nightly</pre>

    <p>See <a href="/en-US/Add-ons/SDK/Tools/jpm#Selecting_a_browser_version">Selecting a browser version</a>.</p>
   </td>
  </tr>
  <tr>
   <td><code>--binary-args CMDARGS</code></td>
   <td>
    <p>Pass <a href="http://kb.mozillazine.org/Command_line_arguments">extra arguments</a> to Firefox.</p>

    <p>For example, to pass the <code>-jsconsole</code> argument to Firefox, which will launch the <a href="/en-US/docs/Tools/Browser_Console">Browser Console</a>, try the following:</p>

    <pre class="brush: bash">
jpm test --binary-args -jsconsole</pre>

    <p>To pass multiple arguments, or arguments containing spaces, quote them:</p>

    <pre class="brush: bash">
jpm test --binary-args '-url mzl.la -jsconsole'</pre>
   </td>
  </tr>
  <tr>
   <td><code>--debug</code></td>
   <td>Run the <a href="/en-US/Add-ons/Add-on_Debugger">add-on debugger</a> attached to the add-on.</td>
  </tr>
  <tr>
   <td style="width: 30%;"><code>-f --filter FILE[:TEST]</code></td>
   <td>
    <p>Only run tests whose filenames match FILE and optionally match TEST, both regexps.</p>

    <pre class="brush: bash">
jpm test --filter base64:btoa</pre>

    <p>The above command only runs tests in files whose names contain "base64", and in those files only runs tests whose names contain "btoa".</p>
   </td>
  </tr>
  <tr>
   <td style="width: 30%;"><code>-o --overload PATH</code></td>
   <td>
    <p>Rather than use the SDK modules built into Firefox, use the modules found at PATH. If <code>-o</code> is specified and PATH is omitted, jpm will look for the JETPACK_ROOT environment variable and use its value as the path.</p>

    <p>See <a href="/en-US/Add-ons/SDK/Tools/jpm#Overloading_the_built-in_modules">Overloading the built-in modules</a> for more information.</p>
   </td>
  </tr>
  <tr>
   <td style="width: 30%;"><code>-p --profile<code> PROFILE</code></code></td>
   <td>
    <p>By default, jpm uses a clean temporary Firefox <a href="http://support.mozilla.com/en-US/kb/profiles">profile</a> each time you call jpm run. Use the <code>--profile</code> option to instruct jpm to launch Firefox with an existing profile.</p>

    <p>The PROFILE value may be a profile name or the path to the profile.</p>

    <p>See <a href="/en-US/Add-ons/SDK/Tools/jpm#Using_profiles">Using profiles</a> for more information.</p>
   </td>
  </tr>
  <tr>
   <td><code>--stop-on-error</code></td>
   <td>
    <p>By default jpm test keeps running tests even after tests fail. Specify <code>--stop-on-error</code> to stop running tests after the first failure:</p>

    <pre class="brush: bash">
jpm test --stop-on-error</pre>
   </td>
  </tr>
  <tr>
   <td><code>--tbpl</code></td>
   <td>Print test output in <a href="https://treeherder.mozilla.org/">Treeherder</a> format</td>
  </tr>
  <tr>
   <td><code>--times NUMBER</code></td>
   <td>
    <p>Run tests NUMBER of times:</p>

    <pre class="brush: bash">
jpm test --times 2</pre>
   </td>
  </tr>
  <tr>
   <td><code>-v --verbose</code></td>
   <td>Verbose operation.</td>
  </tr>
  <tr>
   <td><code>--no-copy</code></td>
   <td>
    <div class="warning">Use with caution because <code>jpm run|test</code> changes many preferences, never use with your main profile.</div>

    <div class="note">This only applies when <code>--profile</code> is used.</div>
    Disables the copying of the profile used, which allows one to reuse a profile.</td>
  </tr>
 </tbody>
</table>

<h3 id="jpm_xpi">jpm xpi</h3>

<p>This command packages the add-on as an <a href="https://developer.mozilla.org/en/XPI">XPI</a> file, which is the install file format for Mozilla add-ons.</p>

<pre class="brush: bash">jpm xpi</pre>

<p>It looks for a file called <code>package.json</code> in the current directory and creates the corresponding XPI file. It ignores any ZIPs or XPIs in the add-on's root, and any test files.</p>

<p>Once you have built an XPI file you can distribute your add-on by submitting it to <a href="http://addons.mozilla.org">addons.mozilla.org</a>.</p>

<p><code>jpm xpi</code> accepts the following option:</p>

<table class="fullwidth-table standard-table">
 <tbody>
  <tr>
   <td><code>-v --verbose</code></td>
   <td>
    <p>Verbose operation:</p>

    <pre class="brush: bash">
jpm xpi -v</pre>
   </td>
  </tr>
 </tbody>
</table>

<h3 id="jpm_post">jpm post</h3>

<p>This command packages the add-on as an <a href="https://developer.mozilla.org/en/XPI">XPI</a> file, the posts it to some url.</p>

<pre class="brush: bash">jpm post</pre>

<p>It looks for a file called <code>package.json</code> in the current directory and creates a XPI file with which to post to the <code>--post-url</code>.</p>

<p><code>jpm post</code> accepts the following options:</p>

<table class="fullwidth-table standard-table">
 <tbody>
  <tr>
   <td><code>--post-url URL</code></td>
   <td>
    <p>The url to post the extension to after creating a XPI.</p>

    <pre class="brush: bash">
jpm post --post-url http://localhost:8888/</pre>

    <p>See <a href="https://www.npmjs.com/package/jpm#using-post-and-watchpost">Using Post and Watchpost</a> for more information.</p>
   </td>
  </tr>
  <tr>
   <td><code>-v --verbose</code></td>
   <td>
    <p>Verbose operation:</p>

    <pre class="brush: bash">
jpm post --post-url http://localhost:8888/ -v</pre>
   </td>
  </tr>
 </tbody>
</table>

<h3 id="jpm_watchpost">jpm watchpost</h3>

<p>This command packages the add-on as an <a href="https://developer.mozilla.org/en/XPI">XPI</a> file, the posts it to some url whenever a file in the current working directory changes.</p>

<pre class="brush: bash">jpm watchpost</pre>

<p>Creates a XPI whenever a file in the current working directory changes and posts that to the <code>--post-url</code>.</p>

<p><code>jpm watchpost</code> accepts the following options:</p>

<table class="fullwidth-table standard-table">
 <tbody>
  <tr>
   <td><code>--post-url URL</code></td>
   <td>
    <p>The url to post the extension to after creating a XPI.</p>

    <pre class="brush: bash">
jpm watchpost --post-url http://localhost:8888/</pre>

    <p>See <a href="https://www.npmjs.com/package/jpm#using-post-and-watchpost">Using Post and Watchpost</a> for more information.</p>
   </td>
  </tr>
  <tr>
   <td><code>-v --verbose</code></td>
   <td>
    <p>Verbose operation:</p>

    <pre class="brush: bash">
jpm watchpost --post-url http://localhost:8888/ -v</pre>
   </td>
  </tr>
 </tbody>
</table>

<h2 id="Techniques">Techniques</h2>

<h3 id="Selecting_a_browser_version">Selecting a browser version</h3>

<p>By default, <code>jpm run</code> and <code>jpm test</code> will run the release version of Firefox. You can instruct jpm to use a different version in one of two ways:</p>

<ul>
 <li>
  <p>you can use the <code>-b</code> or <code>--binary</code> option to instruct jpm to run a different version of Firefox. You can supply a path to a specific binary:</p>

  <pre class="brush: bash">jpm run -b /path/to/Firefox/Nightly</pre>

  <p>As a shorthand for this, you can pass "nightly", "aurora", "beta", or "firefox" and jpm will look in the default location for these Firefox versions:</p>

  <pre class="brush: bash">jpm run -b nightly</pre>
 </li>
 <li>
  <p>you can set the <code>JPM_FIREFOX_BINARY</code> environment variable with the path to the version of Firefox you want to run. When you invoke <code>jpm run</code> or <code>jpm test</code> without the <code>-b</code> option, jpm will first check  <code>JPM_FIREFOX_BINARY</code>, and use this as the path if it is set.</p>
 </li>
</ul>

<h3 id="Using_.jpmignore_to_ignore_files">Using <code>.jpmignore</code> to ignore files</h3>

<p>Using <code>.jpmignore</code> is similar to using <code>.gitignore</code> with <code>git</code>, <code>.hgignore</code> with Mercurial, or <code>.npmignore</code> with <code>npm</code>. By using this file you can let <code>jpm</code> know which files you would like it to ignore when building a <code>.xpi</code> file with <code>jpm xpi</code>.</p>

<p>Here is an example:</p>

<pre class="brush: bash"># Ignore .DS_Store files created by mac
.DS_Store

# Ignore any zip or xpi files
*.zip
*.xpi
</pre>

<p>A <code>.jpmignore</code> file with the above contents would ignore all zip files and <code>.DS_Store</code> files from the xpi generated by <code>jpm xpi</code>.</p>

<h3 id="Using_profiles_2"><a name="Using_profiles">Using profiles</a></h3>

<p>By default, <code>jpm run</code> uses a new profile each time it is executed. This means that any profile-specific data entered from one run of <code>jpm</code> will not, by default, be available in the next run.</p>

<p>This includes, for example, any extra add-ons you installed, or your history, or any data stored using the <a href="/en-US/Add-ons/SDK/High-Level_APIs/simple-storage">simple-storage</a> API.</p>

<p>To make <code>jpm</code> use a specific profile, pass the <code>--profile</code> option, specifying the name of the profile you wish to use, or the path to the profile.</p>

<pre class="brush: bash">jpm run --profile boogaloo
</pre>

<pre class="brush: bash">jpm run --profile path/to/boogaloo</pre>

<p>If you supply <code>--profile</code> but its argument is not the name of or path to an existing profile, jpm will open the <a href="https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles">profile manager</a>,  enabling you to select and existing profile or create a new one:</p>

<pre class="brush: bash">jpm run --profile i-dont-exist</pre>

<h3 id="Developing_without_browser_restarts">Developing without browser restarts</h3>

<p>Because <code>jpm run</code> restarts the browser each time you invoke it, it can be a little cumbersome if you are making very frequent changes to an add-on. An alternative development model is to use the <a href="https://addons.mozilla.org/en-US/firefox/addon/autoinstaller/" rel="noreferrer">Extension Auto-Installer</a> add-on: this listens for new XPI files on a specified port and installs them automatically. That way you can test new changes without needing to restart the browser:</p>

<ul>
 <li>make a change to your add-on</li>
 <li>run <code>jpm post --post-url http://localhost:8888/</code>, to make a xpi and post it.</li>
</ul>

<p>You could even automate this workflow with a simple script. For example:</p>

<pre class="brush: bash">jpm watchpost --post-url http://localhost:8888/
</pre>

<p>Note that the logging level defined for the console is different when you use this method, compared to the logging level used when an add-on is run using <code>jpm run</code>. This means that if you want to see output from <a href="/en-US/Add-ons/SDK/Tutorials/Logging" rel="noreferrer"><code>console.log()</code></a> messages, you'll have to tweak a setting. See the documentation on <a href="/en-US/Add-ons/SDK/Tools/console#Logging_Levels" rel="noreferrer">logging levels</a> for the details on this.</p>

<h3 id="Overloading_the_built-in_modules">Overloading the built-in modules</h3>

<p>The SDK modules you use to implement your add-on are built into Firefox. When you run or package an add-on using <code>jpm run</code> or <code>jpm xpi</code>, the add-on will use the versions of the modules in the version of Firefox that hosts it.</p>

<p>As an add-on developer, this is usually what you want. But if you're developing the SDK modules themselves, of course, it isn't. In this case you need to:</p>

<ul>
 <li>get a local copy of the SDK modules that you want: this usually means checking out the SDK from its <a href="https://github.com/mozilla/addon-sdk" rel="noreferrer">GitHub repo</a></li>
 <li>set the <code>JETPACK_ROOT</code> environment variable to your local copy</li>
 <li>pass the <code>-o</code> option to <code>jpm run</code> or <code>jpm xpi</code>:</li>
</ul>

<pre>jpm run -o
</pre>

<p>This instructs jpm to use the local copies of the SDK modules, not the ones in Firefox. If you don't want to set the <code>JETPACK_ROOT</code> environment variable, you can pass the location of your copy of the SDK modules along with <code>-o</code>:</p>

<pre>jpm run -o "/path/to/SDK/"</pre>