diff options
Diffstat (limited to 'files/th/archive/b2g_os/simulator/index.html')
-rw-r--r-- | files/th/archive/b2g_os/simulator/index.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/files/th/archive/b2g_os/simulator/index.html b/files/th/archive/b2g_os/simulator/index.html new file mode 100644 index 0000000000..164bf61eb2 --- /dev/null +++ b/files/th/archive/b2g_os/simulator/index.html @@ -0,0 +1,58 @@ +--- +title: Firefox OS Simulator +slug: Archive/B2G_OS/Simulator +translation_of: Archive/B2G_OS/Simulator +--- +<div class="note"> + <p>This page describes the Firefox OS Simulator for developers targeting Firefox OS 1.2 or later. If you're developing apps for Firefox OS 1.1, then you should check out the documentation for the <a href="/en-US/docs/Tools/Firefox_OS_1.1_Simulator">Firefox OS 1.1 Simulator</a> instead.</p> +</div> +<p><span style="line-height: 1.5;">The Firefox OS Simulator is <span style="line-height: 1.5;">a version of the higher layers of Firefox OS</span> that simulates a Firefox OS device, but runs on the desktop</span><span style="line-height: 1.5;">. This means that in many cases, you don't need a real device to test and debug your app. </span><span style="line-height: 1.5;">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.</span></p> +<p><span style="line-height: 1.5;">The Simulator is packaged and distributed as a Firefox add-on. Once you've downloaded it and installed it in Firefox, you can run it, push apps to it, and attach the developer tools to it,</span><span style="line-height: 1.5;"> using the </span><a href="/docs/Tools/WebIDE"><span style="line-height: 1.5;">WebIDE</span></a><span style="line-height: 1.5;">.</span></p> +<h2 id="Installation"><span style="line-height: 1.5;">Installation</span></h2> +<p><span style="line-height: 1.5;">To install the simulator, use <a href="/docs/Tools/WebIDE#Adding_a_Simulator">WebIDE's Manage Simulators pane</a> (available as part of Firefox 33 and onwards). Multiple versions are available, and you are advised to install them all, for maximum flexibility.</span></p> +<p>To start the Simulator, you choose it from WebIDE's runtime list. For more details, see the <a href="/docs/Tools/WebIDE#Selecting_a_runtime" style="font-size: 14px; font-weight: normal; line-height: 1.5;">instructions in the WebIDE documentation</a>. Once the Simulator's running, you can push apps to it and debug them using the WebIDE, just as you can with a real device.</p> +<p>If you are using the <a href="/Firefox_OS/Using_the_App_Manager">App Manager</a> (an older tool available prior to the WebIDE), you can install a simulator via the following button:</p> +<p><a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/" style="margin-bottom: 20px; padding: 10px; color: white; text-align: center; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; display: inline-block; background-color: rgb(129, 188, 46); white-space: nowrap; text-shadow: rgba(0, 0, 0, 0.247059) 0px 1px 0px; box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px 0px, rgba(0, 0, 0, 0.298039) 0px -1px 0px 0px inset;">Install Simulator</a></p> +<h2 id="The_Simulator_UI" style="line-height: 30px;">The Simulator UI</h2> +<p><span style="line-height: 22.00800132751465px;">The Simulator appears as a separate window, sized so the simulated screen area is 320x480 pixels. </span><span style="line-height: 22.00800132751465px;">To simulate touch events you can click the mouse button and drag while holding the button down. So by clicking and dragging right-to-left from the Home Screen, you'll see the built-in apps, as well as any apps you have added:</span></p> +<p><img alt="" src="https://mdn.mozillademos.org/files/7173/simulator-1.2.png" style="width: 810px; height: 623px; display: block; margin: 0px auto;"></p> +<p>The Simulator has two buttons in a toolbar at the bottom:</p> +<ul> + <li>the button on the left takes you to the Home screen, or switches the Simulator off if you hold it down</li> + <li>the button on the right switches the Simulator between portrait and landscape orientation. This will generate the <a href="https://developer.mozilla.org/en-US/docs/WebAPI/Managing_screen_orientation#Listening_orientation_change" title="/en-US/docs/WebAPI/Detecting_device_orientation">orientationchange</a> event.</li> +</ul> +<h2 id="Limitations_of_the_Simulator">Limitations of the Simulator</h2> +<p>Note that the Firefox OS Simulator isn't a perfect simulation.</p> +<h3 id="Hardware_limitations">Hardware limitations</h3> +<p>Apart from screen size, the Simulator does not simulate the hardware limitations of a Firefox OS device such as available memory or CPU speed.</p> +<h3 id="Audiovideo_codecs">Audio/video codecs</h3> +<p>The following codecs depend on hardware-accelerated decoding and are therefore not yet supported:</p> +<ul> + <li>MP3</li> + <li>AAC</li> + <li>H.264 (MP4)</li> + <li>WebM</li> +</ul> +<p>This means it isn't possible to use the Simulator to test video playback in apps and on websites like Youtube that rely on these codecs.</p> +<h3 id="Unsupported_APIs"><a name="Unsupported-APIs">Unsupported APIs</a></h3> +<p>Certain APIs that work on the device won't work on the Simulator, generally because the supporting hardware is not available on the desktop. We've implemented simulations for some APIs such as geolocation, and expect to add more in future releases. However, at the moment the following APIs are not supported. Using them might throw errors or just return incorrect results:</p> +<ul> + <li><a href="/en-US/WebAPI/WebTelephony" title="/en-US/WebAPI/WebTelephony">Telephony</a></li> + <li><a href="/en-US/docs/WebAPI/WebSMS" title="/en-US/docs/WebAPI/WebSMS">WebSMS</a></li> + <li><a href="/en-US/docs/WebAPI/WebBluetooth" title="/en-US/docs/WebAPI/WebBluetooth">WebBluetooth</a></li> + <li><a href="/en-US/docs/WebAPI/Using_Light_Events" title="/en-US/docs/WebAPI/Using_Light_Events">Ambient Light</a></li> + <li><a href="/en-US/docs/WebAPI/Proximity" title="/en-US/docs/WebAPI/Proximity">Proximity</a></li> + <li><a href="/en-US/docs/WebAPI/Network_Information" title="/en-US/docs/WebAPI/Network_Information">Network Information</a></li> + <li><a href="/en-US/docs/Online_and_offline_events" title="/en-US/docs/Online_and_offline_events">navigator.onLine and offline events</a></li> + <li><a href="/en-US/docs/WebAPI/Vibration" title="/en-US/docs/WebAPI/Vibration">Vibration</a></li> +</ul> +<h2 id="Getting_help"><a name="Simulator-help"></a>Getting help</h2> +<p><span style="line-height: 1.5;">If you have a question, try asking us on the </span><a href="https://lists.mozilla.org/listinfo/dev-developer-tools" style="line-height: 1.5;">dev-developer-tools mailing list</a><span style="line-height: 1.5;"> or on </span><a href="irc://irc.mozilla.org/#devtools" style="line-height: 1.5;">#devtools on irc.mozilla.org</a><span style="line-height: 1.5;">.</span></p> +<h3 id="How_to_enable_verbose_logging"><a name="Simulator-verbose-logging"></a>How to enable verbose logging</h3> +<p>You can see messages logged from your app in the <a href="/en-US/docs/Tools/Web_Console">Web Console</a>, which you can attach to your app using the <a href="/docs/Tools/WebIDE/Troubleshooting">WebIDE</a>. If you want to catch early messages happening during app startup, before the console gets connected and working, you can enable verbose logging in the Simulator.</p> +<p>Visit about:config and <strong>create</strong> a new preference. The preference name is different for each version of the Simulator:</p> +<ul> + <li>extensions.fxos_1_3_simulator@mozilla.org.sdk.console.logLevel for Firefox OS 1.3</li> + <li>extensions.fxos_1_2_simulator@mozilla.org.sdk.console.logLevel for Firefox OS 1.2</li> +</ul> +<p>Set it to the string value "all", and disable, then reenable, the add-on in the Add-on Manager. Now extra messages about the Simulator's operation will appear in the <a href="/en-US/docs/Tools/Browser_Console">Browser Console</a>.</p> |