앱 관리자는 Firefox 데스크톱에서 제공하는 새로운 도구로, Firefox OS phone과 Firefox OS 시뮬레이터에서 HTML5 웹앱을 테스트, 배치, 디버그할 수 있도록 돕는 여러 도구들을 브라우저에서 직접 제공합니다.
앱 관리자는 다음과 같이 구성되어 있습니다:
- 앱 패널: 로컬 앱(소스코드가 자신의 컴퓨터에 위치)과 외부에서 호스팅되는 앱을 관리합니다. 이들을 패키징하고 장치나 시뮬레이터에 설치할 수 있으며 툴박스를 사용해 디버그도 할 수 있습니다.
- 장치 패널: 연결된 장치의 Firefox OS버전, 장치 API 사용에 필요한 퍼미션, 설치된 앱들에 대한 정보를 표시합니다.
- 툴박스: 앱 패널을 통해 실행중인 앱에 연결하고 디버깅 동작을 수행할 수 있는 개발도구(웹 콘솔, 인스펙터, 디버거 등)들의 세트입니다.
- Firefox 데스크톱 26 이상을 설치했는지 확인하세요.
- 앱 관리자를 엽니다. (URL바에
- 실제 장치가 없는 경우:
- Firefox OS 시뮬레이터를 설치합니다.
- 앱 관리자의 아래쪽 툴바에서 시뮬레이터 시작을 클릭하고 뒤이어 표시되는 설치된 시뮬레이터의 이름을 클릭합니다.
- 실제 장치가 있는 경우:
- 장치가 Firefox OS 1.2 이상을 구동중인지 확인하세요.
- Windows의 경우, 폰 제조사에서 제공하는 드라이버의 설치를 확인하세요.
- 장치의 설정에서 화면 잠금을 비활성화하고 (
Settings >) 원격 디버깅을 활성화합니다(
Settings > Device information > More information > Developer).
- Firefox Desktop에 ADB Helper 추가기능을 설치합니다.
- USB케이블로 장치와 컴퓨터를 연결하세요.
- 앱 관리자 하단에 장치의 이름이 나타나면 클릭합니다.
- 하단 바에 "xxx에 연결됨"이 표시됩니다.
- 앱 패널을 클릭해 앱을 추가합니다(패키지 또는 hosted).
- The Refresh button validates your app and installs it on the Simulator/Device
- The Debug button connects the developer tools to the running app
- 문제가 발생한다면 Troubleshooting섹션을 참조하세요.
앱 관리자를 사용할 때 가장 처음 해야할 일은 여러분의 시스템과 폰이 제대로 설정되었는지 확인하는 것입니다. 이 섹션에서 필요한 단계들을 알아보겠습니다.
Firefox 1.2 이상 필요
장치가 Firefox OS 1.2/Boot2Gecko 1.2 또는 그 이상을 구동중인지 확인하세요. 장치의 Firefox OS 버전을 확인하려면
Settings > Device Information > Software로 이동하십시오.
If you don't have a high enough version installed, depending on what phone you have you will need to either install an available nightly build of Firefox 1.2+, or configure and build it yourself from source.
Geeksphone Keon/Peak builds (to find out more about using these, read Updating and Tweaking your Firefox OS Developer Preview phone/Geeksphone)
More to follow
원격 디버깅(Remote debugging)
Next, you need to enable remote debugging in Firefox OS. To do so, go to
Settings > Device information > More information > Developer and check the Remote Debugging checkbox.
ADB or ADB helper
The process uses the Android Debug Bridge (ADB) to handle the device-computer connection and communication. There are two options for running ADB:
Let Firefox handle ADB (recommended). Install the ADB Helper add-on, which makes the process easier. With this installed, there's no need to install the ADB, and no need to type the
adb forward command: everything is handled by the add-on.
Use ADB manually. You need to have it installed on your computer - download and install
adb (see the Get the Android SDK) as part of the Android SDK package. You'll need to enable port forwarding by entering the following command into your terminal:Note that you'll need to do this every time the phone is restarted or unplugged then re-plugged.
Note: ADB Helper 확장기능을 설치했다면 이 명령을 실행할 필요가 없습니다.
Connecting your device to the App Manager
With all your configuration done, it's now time to plug your device into your computer and start the App Manager:
- Plug the device into your computer via USB.
- Disable Screen lock on your device by going to
Settings > Screen Lockand unchecking the
Lock Screencheckbox. This is a good idea because when the screen gets locked, the phone connection gets lost, meaning it is no longer available for debugging.
- Start the App Manager — In Firefox Desktop select the
Tools > Web Developer > App Managermenu option, or type
about:app-managerin the URL bar.
- At the bottom of the App Manager tab, you will see a connection status bar (see screenshot below). You should be able to connect your device by clicking the "Connect to localhost:6000" button.
- If this works successfully, a prompt should appear on your device: "An incoming request to permit remote debugging connection was detected. Allow connection?". Tap the OK button (You may also have to press the power button on the phone so you can see the prompt.) The connection status bar should update to say "Connected to B2G", with a Disconnect button available to press if you want to cancel the connection.
Note that the other controls in the connection status bar allow you to connect a simulator to the App Manager, which we cover in the next section, below, and change the port that the connection happens on. If you change the port, you'll also need to enable port forwarding for this port as well, as instructed in the Enable port forwarding section, above.
If you haven't got a real device available to use with App Manager, you can still try it out using a Firefox OS Simulator Add-on. To start off, install the appropriate simulator for your operating system:
앞으로 더 많은 것들이 등장하겠지만, 지금은 Firefox OS 1.2 시뮬레이터만 이용할 수 있습니다.
Once you've installed the simulator, you need to go to the connection status bar at the bottom of the App Manager tab, and click the "Start simulator" button. Three buttons will appear:
- "Firefox OS 1.2" ... etc (or something similar): the leftmost button contains the name of the simulator version you have installed. Click it to start the connection to the simulator.
- "Add": the middle button navigates to the simulator install links in this article, so you can add more Simulators (Firefox OS 1.2, Firefox OS 1.3, ...).
- "Cancel": the right hand button cancels the connection.
Now everything is working, let's review the functionality available inside the App Manager, starting with the Apps panel. From here, you can import an existing app to push onto your device and debug:
- To install a local app, click on the plus next to the "Add Packaged App" label and use the resulting file chooser dialog to select the directory your app is contained inside.
- To install an externally hosted app, enter the absolute URL of the app's manifest file into the text field inside the "Add Hosted App" box, then press the plus button.
Information about your app should appear on the right hand side of the window, as seen below:
From Firefox 28 onwards, the Apps Panel includes an editor for the app manifest:
Clicking on "Update" will update (install) the app on the device. Clicking on "debug" will connect a toolbox to the app, allowing you to debug its code directly:
Note: You'll enjoy playing around with the toolbox — try altering the DOM, CSS etc. and you'll see the updates reflected on the device in realtime. Such updates will be saved on the installed app code; you'll see them next time you open the app on the device.
Before Firefox 28, the tools are launched in a separate window. From Firefox 28 onwards, the tools are launched in a separate tab in the App Manager itself, alongside the Apps and Device tabs. The tab is given your app's icon so it's easy to find:
If an app was not added successfully — for example if the URL was incorrect, or you selected a packaged app folder — an entry will be added to the page for this app, but this will include error information.
You can also delete an app from this view, by hovering over the App name/description on the left of the window, and pressing the "X" button that appears in each case. This however doesn't remove the app from the device. To do that you need to manually remove the app using the device itself.
The Device tab displays information about the connected device. From the "Installed Apps" window, apps on the device can be started and debugged.
Note: Certified Apps are not listed by default. See how to debug certified apps.
The "Permissions" window shows the required priviledges for different Web APIs on the current device:
Finally, you can take a screenshot of the current device display by clicking the "Screenshot" button. The screenshot appears in a new tab on Firefox, and from there you can save or discard it as you wish.
Currently only devices running a development build of Firefox OS 1.2 are capable of debugging certified apps. If you have a development build, you can enable certified app debugging by changing the pref
false in your profile. To do this, follow the steps below:
On your computer, enter the following command in Terminal/console to enter your device's filesystem via the shell:
Your prompt should change to
Next, stop B2G running using the following command:
Navigate to the following directory:
Here, update the prefs.js file with the following line:
echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
After you've finished editing and saving the file, start B2G again using the following command:
Exit the android filesystem using the
exitcommand; this will return you to your normal terminal prompt.
Next, reconnect to the App Manager and you should see certified apps appear for debugging.
Note: If you want to add this preference to your Gaia build you can run
make DEVICE_DEBUG=1 reset-gaia.
장치가 인식되지 않을 경우:
- Read the Device and system configuration section thoroughly, and make sure all the steps are followed:
- 장치가 최소 Firefox OS 1.2를 구동중인가요?
- Don't see all the apps? Do you need to enable Certified Apps debugging?
- 폰의 settings에서 "원격 디버깅"을 활성화했습니까?
- ADB Helper 확장기능을 사용중이라면:
adb forward명령을 성공적으로 실행했습니까?
- If you are using the ADB Helper add-on and your device is not listed in the bottom toolbar:
- Linux상의 장치이름 대신 "???????"가 보이나요? 퍼미션에 문제가 있습니다. udev 설정을 확인해 보십시오.
- 폰의 화면잠금이 해제되었습니까?