From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- files/it/tools/webide/index.html | 333 ----------------------- files/it/tools/webide/monitor/index.html | 160 ----------- files/it/tools/webide/troubleshooting/index.html | 106 -------- 3 files changed, 599 deletions(-) delete mode 100644 files/it/tools/webide/index.html delete mode 100644 files/it/tools/webide/monitor/index.html delete mode 100644 files/it/tools/webide/troubleshooting/index.html (limited to 'files/it/tools') diff --git a/files/it/tools/webide/index.html b/files/it/tools/webide/index.html deleted file mode 100644 index 2e2bad73d0..0000000000 --- a/files/it/tools/webide/index.html +++ /dev/null @@ -1,333 +0,0 @@ ---- -title: WebIDE -slug: Tools/WebIDE -translation_of: Archive/WebIDE ---- -
-

WebIDE è disponibile da Firefox 34 in poi.

- -

Puoi attivare WebIDE anche in Firefox 33, semplicemente cambiando una preferenza: digita about:config nella barra degli indirizzi e imposta come vero il parametro di devtools.webide.enabled.

-
- -
-

WebIDE è il sostituto di App Manager. Come App Manager,  ti permette di usare e fare il debug delle app di Firefox OS usando Firefox OS Simulator oppure un normale dispositivo con Firefox OS.

- -

WebIDE include un ambiente di editing che ti permette di creare e sviluppare app per Firefox OS, fornisce una visione ad albero di tutti i file presenti nella tua app con la possibilità di modificarli e salvarli, e in più due template per aiutarti a iniziare.

- -

Inoltre, WebIDE ti permette di connetere i Firefox Developer Tools ad altri browser, come Firefox per Android, Chrome per Android e Safari su iOS. Dai un'occhiata alla pagina Debug Remoto per ottenere informazioni su come connetterti ad un browser specifico.

-
- -

Con WebIDE, per prima cosa devi impostare una o più runtime. Una runtime, è l'ambiente in cui testerai ed eseguirai il debug di un App. La runtime potrebbe essere un device con a bordo Firefox OS connesso tramite cavo USB, oppure Firefox OS Simulator installato sul computer.

- -

Adesso, puoi creare un app, o aprire un app esistente. Se stai creando una nuova app, puoi partire da un template che include la struttura base delle cartelle e un modello contenente il minimo indispensabile per iniziare a sviluppare, oppure usare un template più corposo che mostra come usare una API privilegiata. Con WebIDE puoi modificare e salvare i file della tua app, che vengono mostratti in una struttura ad albero, attraverso un editor incorporato. Ovviamente non sei obbligato ad usare l'editor incorporato, puoi sviluppare l'app esternamente ed usare WebIDE solamente per eseguire il debug.

- -

Infine, puoi installare l'app in  una delle runtime ed eseguirla. Durante l'esecuzione dell'app puoi osservarla e modificarla tramite gli strumenti per lo sviluppo come l'Inspector, la Console, Il Debugger Javascript e molto altro.

- -

Requisiti di sistema

- -

Per sviluppare ed eseguire il debug delle app utilizzando WebIDE, tutto ciò che ti serve è Firefox 23 o versioni successive.  Per testare l'app su un dispositivo vero e proprio, hai bisogno di un device che abbia Firefox OS 1.2 o versioni successive.

- -

Puoi usare WebIDE solamente se il tuo sviluppo riguarda Firefox OS 1.2 o versioni successive.

- -

Aprire WebIDE

- -

WebIDE può essere aperto in tre modi:

- - - -

- -

Ecco WebIDE in azione:Il menu a cascata sulla sinistra denominato "Apri App", ti permette di aprire un app esistente o di crearne una nuova, mentre il menu sulla destra ti permette di scegliere una runtime o crearne una nuova.

- -

I tasti esegui, stop e debug: appaiono solamente dopo aver aperto un app e selezionato una runtime.

- -

Da Firefox 36, puoi modificare la grandezza del font in WebIDE utilizzando le seguenti scorciatoie da tastiera (usa il tasto Command al posto Control se stai usando OS X):

- - - -

Impostare le runtime

- -

Nel menu "Seleziona Runtime", le runtime sono raggruppate in tre tipi:

- - - -

La prima volta che clicchi il menu, probabilmente non vedrai alcuna runtime:

- -

Il resto di questa sezione mostra come fare per aggiungere delle runtime.

- -

Connettersi ad un device Firefox OS

- -

Prima di connetterti ad un device, ci sono alcune cose da fare:

- - - -
-

Linux only:

- - -
- -
-

Windows only:

- - -
- -

If there are any other Android devices connected to your computer, disconnect them. Now connect the device to the computer using USB. You should see the device appear under "USB DEVICES":

- -

- -

If you don't see your device, see the Troubleshooting page.

- -

Connecting to Firefox for Android

- -

From Firefox 36 onwards Android devices connected over USB and running Firefox for Android appear as a runtime under "USB devices". See the article on connecting to Firefox for Android from WebIDE.

- -

Before Firefox 36, you can connect to Firefox for Android without using WebIDE at all, or can use WebIDE by setting up a custom remote runtime.

- -

Adding a Simulator

- -

The Firefox OS Simulator is a version of the higher layers of Firefox OS that simulates a Firefox OS device, but runs on the desktop. It runs in a window the same size as a Firefox OS device, includes the Firefox OS user interface and built-in apps, and simulates many of the Firefox OS device APIs.

- -

This means that in many cases, you don't need a real device to test and debug your app.

- -

The Simulator is big, so it doesn't ship inside Firefox but as a Firefox add-on. If you click "Install Simulator" in the Runtimes dropdown menu, you will go to a page from which you can install Simulators for various versions of Firefox OS.

- -

You can install as many as you like. Be patient, though: the Simulator is large and may take a few minutes to download. Once you've installed some Simulators you can close this "Extra Components" window, and the Simulators you've installed appear as options in the Runtimes dropdown menu:

- -

To learn more about the Simulator, see its documentation page.

- -

Custom runtimes

- -

Remote runtime

- -

With a custom remote runtime you can use an arbitrary hostname and port to connect to the remote device.

- -

Under the hood, Firefox OS devices and Android devices connect to the desktop using a program called the Android Debug Bridge, or ADB. By default, WebIDE uses an add-on called the ADB Helper: this simplifies the process for you by installing ADB and setting up port forwarding so the Firefox desktop tools can exchange messages with the device.

- -

This is convenient in most cases, but sometimes you might want to use ADB outside of WebIDE: for example, you might be running ADB directly from the command line. In that case you'll connect to the device by specifying a host and port using the adb forward command (example: adb forward tcp:6000 localfilesystem:/data/local/debugger-socket).
-
- If you then want to use WebIDE to connect as well, you should disable the ADB Helper add-on and connect WebIDE using the Custom runtime option, entering the host and port that you passed to adb forward (example: localhost:6000).

- -

Also, before Firefox 36, the ADB Helper does not yet support connecting to Firefox for Android, so if you want to connect WebIDE to Firefox for Android, you'll need to set up your own port forwarding and use a custom runtime. See more about connecting to Firefox for Android using ADB prior to Firefox 36.

- -

Valence-enabled runtimes

- -

If you have the Valence add-on installed, you'll see three additional runtimes:

- - - -

For instructions on how to connect to these runtimes, see the relevant entry in the Remote Debugging page.

- -

Selecting a runtime

- -

Once you've set up a runtime you can select it using the "Select Runtime" menu.

- - - -

Now the "play" button in the center of the WebIDE toolbar is enabled: click it to install and run the app in the selected runtime.

- -

Runtime actions

- -

When a runtime is selected, the Runtimes dropdown menu has three extra items:

- - - -

- -

- -

Creating and opening apps

- -

Under the "Open App" menu you get three options: create a new app, open a packaged app, and open a hosted app:

- -

- -

Create a new app

- -

Select "New App..." to create a new app. You'll see a dialog offering you a choice between two templates, "Privileged Empty App" and "Privileged App".

- -

- -

Both templates are from Mozilla's app template collection, and provide you with the basic structure you need to get started. The "Privileged App" shows how an app can use permissions to load cross-origin content.

- -

Once you've selected a template you'll be asked to name the app and select a directory to store the files, and then the new app is opened in the project editor.

- -

Open a packaged app

- -

Select "Open Packaged App..." to open a packaged app. You'll be asked to select a directory containing the app's manifest, and the app will be opened in the project editor.

- -

Open a hosted app

- -

Select "Open Hosted App..." to open a hosted app. You'll be asked to enter a URL pointing to the app's manifest, and the app will be opened in the project editor.

- -

Editing apps

- -

The project editor provides an environment for editing apps. There's a tree view on the left of all the files in the app: you can add and delete files here using a context menu. There's an editor pane on the right.

- -

The app summary page

- -

When you first open or create an app, the editor pane is occupied by the app summary page, which is shown below:

- -

- -

You can always get back to the app summary page by clicking on the root of the tree on the left.

- -

Manifest validation

- -

WebIDE automatically checks the manifest for certain common problems. If it finds a problem it indicates that the app is invalid and describes the problem in the app's summary:

- -

- -

Of course, you can edit the manifest.webapp file right in the project editor as well.

- -

The source editor

- -

WebIDE uses the CodeMirror source editor.

- -

Source editor shortcuts

- -

{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "source-editor") }}

- -

Code completion

- -

When editing CSS and JavaScript, the editor provides autocomplete suggestions. CSS autocompletion is always enabled:

- -

To display autocomplete suggestions in JavaScript press Control + Space:

- -

- -

Inline documentation

- -

The editor also shows inline documentation for JavaScript. Press Shift + Space to see a popup containing documentation for the symbol your cursor is on:

- -

- -

Clicking the [docs] link in the popup will take you to the MDN page for the symbol.

- -

Saving files

- -

For changes to your files to take effect you need to save them. Files with unsaved changes get an asterisk next to their name in the tree view, and you can save files using the menu or Control+S (Command+S on Mac OS X).

- -

Removing projects

- -

To remove an app from WebIDE, go to the app summary page and click "Remove Project".

- -

Running and debugging apps

- -

When you're ready to run the app, you need to select a runtime from the "Select Runtime" dropdown menu. If you don't have any available runtimes here, find out how to add some in Setting up runtimes.

- -

The "play" button in the center of the WebIDE toolbar is now enabled: click it to install and run the app in the selected runtime:

- -

To debug the app, click the "Pause" button and the Developer Tools Toolbox appears, connected to your app:

- -

- -
-

From Firefox 36 onwards, the "Pause" button is replaced with a wrench icon.

-
- -

Exactly which tools you'll have available depends on the runtime, but you will at least have the basics: the Inspector, Console, JavaScript Debugger, Style Editor, Profiler and Scratchpad. Just as in a web page, any changes you make in the tools are visible immediately in the app, but are not persistent. Conversely, any changes you make in the editor pane can be saved straight back to disk, but are not visible without restarting the app.

- -

Unrestricted app debugging (including certified apps, main process, etc.)

- -

You can run the debugger against the simulator, b2g desktop, or a real device.

- -

With the Simulator, if you click on the app dropdown menu while the runtime is selected, you can see and debug not only your app but all apps running in that runtime, including certified apps:

- -

- -


- However, when connecting to a real device we have a security policy in force:

- - - -

To remove this restriction:

- - - -

To disable DevTools restricted privileges, connect to the runtime, and then, in the menu, go to Runtime > Runtime Info. The path then differs depending on what you are debugging against:

- - - -

Now (or after a restart of the B2G desktop client) in WebIDE you should see all the apps on the device.

- -

Monitoring performance

- -

If you're interested in the performance of your apps, there are a few ways to measure their impact on the runtime in WebIDE:

- - - -

Troubleshooting

- -

If you have any problems working with WebIDE, see the Troubleshooting page.

- -

 

- -

 

diff --git a/files/it/tools/webide/monitor/index.html b/files/it/tools/webide/monitor/index.html deleted file mode 100644 index a883cac837..0000000000 --- a/files/it/tools/webide/monitor/index.html +++ /dev/null @@ -1,160 +0,0 @@ ---- -title: Monitor -slug: Tools/WebIDE/Monitor -tags: - - italiano tags -translation_of: Archive/WebIDE/Monitor ---- -
-

The WebIDE Monitor is a general-purpose data tool designed to help you track the performance of Firefox OS apps and devices.

-
- -

The WebIDE Monitor

- -

The Monitor is able to display live, interactive graphs to visualize time series.

- -

Available graphs

- -

The Monitor comes with several different graphs. They usually show up once WebIDE is connected to a Firefox OS runtime.

- -

Unique Set Size

- -

Unique Set Size

- -

This graph shows the memory footprint of all Firefox OS processes over time. If you are interested in the memory consumption of a Firefox OS app, launch it, and the private memory used by its process will be displayed here.

- -

Displaying your own data

- -

It's relatively easy to display any kind of data in the Monitor, because it accepts loosely-formatted updates from many different sources.

- -

From a Firefox OS device

- -

You can send data from a connected device by sending observer notifications.

- -

Note: If you would like to do this in a certified app, please follow these instructions.

- -

JavaScript

- -

Services.obs.notifyObservers(null, 'devtools-monitor-update', data);

- -

You can send data from any JS code with chrome privileges. Here is a complete example measuring the run time of some JS code:

- -

const Services = require('Services');
-
- var start = Date.now();
- // code to benchmark
- var stop = Date.now();
-
- var data = { graph: 'Performance', myFeature: stop-start, time: stop }
;
- Services.obs.notifyObservers(null, 'devtools-monitor-update', JSON.stringify(data));

- -

C++

- -

observerService->NotifyObservers(nullptr, "devtools-monitor-update", data);

- -

You can send data from anywhere in Gecko. Here is a complete example measuring the run time of some code:

- -

#include <time.h>
- #include "nsPrintfCString.h"
- #include "nsIObserverService.h"
-
- clock_t start = clock();
- // code to benchmark
- clock_t stop = clock();
- double time = (double)(stop - start) / (CLOCKS_PER_SEC / 1000);
-
- nsCOMPtr<nsIObserverService> observerService = services::GetObserverService();
- if (observerService) {
-   nsPrintfCString str("{\"graph\":\"Performance\",\"myFeature\":%f}", time);
-   nsAutoString data = NS_ConvertUTF8toUTF16(str);
-   observerService->NotifyObservers(nullptr, "devtools-monitor-update", data.get());
- }

- -

From your computer

- -

You can easily send data to the Monitor over a WebSockets server. This can be useful if you're writing a Firefox extension, a command-line tool or a web service.

- -

By default, the Monitor looks for a server running on the port 9000 of you computer. You can change this by updating the devtools.webide.monitorWebSocketURL preference.

- -

You can even make it accept data from your local network, or from anywhere on the Internet.

- -

Node.js

- -

TODO

- -

Python

- -

TODO

- -

Supported formats

- -

The Monitor accepts data in the form of JSON objects that generally look like this:

- -

{
-   "graph": "myGraph",
-   "curve": "myCurve",
-   "value": 42,
-   "time": 1234567890
- }

- -

That format is meant to be very flexible. If a specified graph or curve doesn't exist, it will be created automatically.

- -

Arbitrary names

- -

Unrecognized entries will be considered as curve name and value.

- -

The smallest data packet you can send is something like:

- -

{ "myCurve": 42 }

- -

This will add a data point to "myCurve" in a graph with no name. The missing time will default to when the Monitor received the packet.

- -

For better precision, it's probably better to always specify a timestamp for your data:

- -

{
-   "current": 60,

-   "voltage": 500,
-   "time": 1234567890
- }

- -

Multiple values

- -

In a single update, you can send data for multiple curves:

- -

{
-   "graph": "myGraph",
-   "myCurve1": 50,
-   "myCurve2": 300,
-   "myCurve3": 9000,
-   "time": 1234567890
- }

- -

Or several data points for a single curve:

- -

{
-   "graph": "myGraph",
-   "curve": "myCurve",
-   "values": [
-     { "time": 1234567890, "value": 42 },
-     { "time": 1234567981, "value": 51 }
-   ]
- }

- -

Multiple updates

- -

And you can also send multiple data updates as an Array:

- -

[
-   { "graph": "Memory", "time": 1234567890, "System": 2600, "My App": 1000 },
-   { "graph": "Power", "time": 1234567890, "current": 60, "voltage": 500 }
- ]

- -

Punctual events

- -

To mark special events in a graph with a vertical bar, add an event key to your update:

- -

{
-   "graph": "myGraph",
-   "event": "myEvent",
-   "time": 1234567980
- }

diff --git a/files/it/tools/webide/troubleshooting/index.html b/files/it/tools/webide/troubleshooting/index.html deleted file mode 100644 index 462bb661d2..0000000000 --- a/files/it/tools/webide/troubleshooting/index.html +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: 'WebIDE, risoluzione dei problemi' -slug: Tools/WebIDE/Troubleshooting -tags: - - 'etichette{locale}' -translation_of: Archive/WebIDE/Troubleshooting ---- -

Connettere un dispositivo Firefox OS tramite USB

- -

Se stai tentando di connettere un dispositivo con Firefox Os al WebIDE e non viene mostrato, ecco alcuni consigli che puoi provare a mettere in atto.

- - - -

Connettere un dispositivo Firefox OS tramite Wi-Fi

- - - -

Connettersi a Firefox per Android

- -

Se stai cercando di connettere il WebIDE con un dispositivo Android su cui esegui Firefox e questo non viene mostrato nel WebIDE ecco alcuni consigli che puoi provare a mettere in atto:

- - - -

Connettersi ad altri browser (Chrome, Safari)

- -

Il WebIDE usa il progetto Valence (conosciuto come Firefox Tools Adapter) per comunicare con altri browser, come  Chrome e  Safari. 

- -

Se ha problemi a connettersi ad altri browser controlla i passaggi per impostare il tuo dispositivo per quel browser sulla pagina del progetto Valence.

- -

Problemi con il debug delle app

- -

Se non riesci a effettuare il debug di app certificate, di sistema o precedentemente installate potresti essere incappato in un problema di insufficenti permessi. Per saperne di più leggi la sezione debug senza restrizioni (app certificate, di sistema, processi, etc.).

- -

Impossibile caricare la lista dei progetti

- -

Se usi il WebIDE ed effettui il downgrade di Firefox ad una versione precedente e continui ad utilizzare lo stesso profilo potresti incontrare l'errore "Impossibile carica la lista dei progetti" quando apri il WebIDE nella versione precedente.

- -

Questo problema può accadere quando il sistema di salvataggio dei progetti del WebIDE (IndexedDB) ha aggiornato o cambiato i suoi file durante l'uso della versione più recente di Firefox. La lista dei progetti è a tutti gli effetti inaccessibile alle versioni più vecchie di Firefox.

- -

Non è stata persa nessuna informazione ma dovrai necessariamente continuare ad utilizzare la versione più recente di Firefox per recuperare la lista dei progetti.

- -

Se vuoi veramente utilizzare la versione meno recente di Firefox puoi provare a cancelleare la lista dei progetti nel seguente modo, ma questa procedura non è supportata e potresti incorrere in altri problemi o altre perdite di informazioni.

- -
    -
  1. Chiudi Firefox
  2. -
  3. Trova la tua cartella dei profili
  4. -
  5. Trova la cartella storage dentro alla cartella del tuo profilo
  6. -
  7. Nel contenuto della cartella ci saranno dei file o cartelle il cui nome comincia per4268914080AsptpcPerjo (una hash del nome del database)
  8. -
  9. Rimuovi tutte le cartelle ed i file in questione
  10. -
  11. Avvia Firefox ed il WebIDE nuovamente
  12. -
- -

Abilitare i log

- -

Puoi inoltre abilitare un logging senza filtri per raccogliere informazioni diagnostiche:

- -
    -
  1. Apri about:config, aggiunti una nuova preferenza chiamata extensions.adbhelper@mozilla.org.sdk.console.logLevel, con il valore in forma di Stringa impostato ad all, ed imposta la proprietà extensions.adbhelper@mozilla.org.debug al valore true.
  2. -
  3. Nella pagina Add-ons Manager, disabilita e abilita nuovamente l'add-on ADB Helper.
  4. -
  5. Apri la Console del Browser e vedrai dei messaggi che hanno come prefisso la stringa adb. Se i messaggi non sono comprensibili per te  chiedi aiuto.
  6. -
- -

Chiedere aiuto

- -

Vai alla stanza #devtools su IRC e proveremo ad aiutarti.

-- cgit v1.2.3-54-g00ecf