canmove, Confirmed users
7,108
edits
No edit summary |
|||
| (42 intermediate revisions by 12 users not shown) | |||
| Line 11: | Line 11: | ||
adb shell getprop ro.build.version.incremental | adb shell getprop ro.build.version.incremental | ||
adb shell getprop ro.build.date | adb shell getprop ro.build.date | ||
== Installing ADB on your machine == | |||
* https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Installing_ADB | |||
* [http://stackoverflow.com/questions/31374085/installing-adb-on-mac-os-x Installing ADB on Mac OSX] | |||
== Screenshots == | |||
For 2.1 are taken via power button + volume down button | |||
For 2.0 it remains power button + home | |||
== Internal Storage == | == Internal Storage == | ||
| Line 97: | Line 106: | ||
* from https://bugzilla.mozilla.org/show_bug.cgi?id=904470#c9 | * from https://bugzilla.mozilla.org/show_bug.cgi?id=904470#c9 | ||
== To get the Device IP == | == To get the Device IP == | ||
| Line 137: | Line 139: | ||
== Adding CA certs to Firefox OS == | == Adding CA certs to Firefox OS == | ||
* http://wiki.mozfr.org/Adding_CA_to_FirefoxOS | * http://wiki.mozfr.org/Adding_CA_to_FirefoxOS | ||
== Getting prefs of the device == | |||
You can use edit-prefs.sh to get the prefs on device. It's located in the B2G repo: | |||
https://github.com/mozilla-b2g/B2G/blob/master/edit-prefs.sh | |||
== Changing preferences == | == Changing preferences == | ||
| Line 152: | Line 158: | ||
User.js Examples: | User.js Examples: | ||
=== RIL Debugging === | |||
The below example turns RIL debugging on | |||
adb pull /system/b2g/defaults/pref/user.js . | adb pull /system/b2g/defaults/pref/user.js . | ||
< edit user.js and set "ril.debugging.enabled" to true > | < edit user.js and set "ril.debugging.enabled" to true > | ||
adb | adb remount | ||
adb push user.js /system/b2g/defaults/pref | adb push user.js /system/b2g/defaults/pref | ||
adb shell sync && adb reboot | adb shell sync && adb reboot | ||
1. adb root | |||
adb remount | |||
2. Pull omni.ja from DUT | |||
adb pull /system/b2g/omni.ja | |||
3. Unzip omni.ja | |||
unzip omni.ja -d Omni | |||
4. Find ril_consts.js in Omni/modules/ | |||
5. Open ril_consts.js and update this.DEBUG_ALL = false to true. | |||
sed -i 's/this.DEBUG_ALL = false;/this.DEBUG_ALL = true;/g' Omni/modules/ril_consts.js | |||
6. cd Omni, zip all files | |||
zip -r omni.ja * | |||
7. Push it back to DUT then reboot it. | |||
adb push omni.ja /system/b2g | |||
adb reboot | |||
https://mozilla.box.com/s/zhr8wg0xae18xhennp2t | |||
Alternative way to turn on ril debugging from settings | |||
[[File:Settings developer.png|200px|Settings > Developer]] | |||
[[File:Settings developer ril.png|200px|Developer > RIL output in ADB]] | |||
=== User Agent === | |||
* The below example overrides the User Agent string to Fennec (Firefox for Android) as per https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference | * The below example overrides the User Agent string to Fennec (Firefox for Android) as per https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference | ||
| Line 170: | Line 199: | ||
adb shell sync && adb reboot | adb shell sync && adb reboot | ||
=== MMS debuging === | |||
* Add 'pref("mms.debugging.enabled", true);' to turn MMS debugging on | * Add 'pref("mms.debugging.enabled", true);' to turn MMS debugging on | ||
| Line 290: | Line 320: | ||
cmd line prompt "root@android:/ #" means you're in rooted mode. | cmd line prompt "root@android:/ #" means you're in rooted mode. | ||
'''Flame Device''' | |||
if you are using a user build on a Flame device and you need have root access. All you need is flashing boot.img from engineering build on top of it, and you'll get the root access. | |||
== Enable Graphics Performance Indicator == | |||
Go to Settings app, select Developer -> Developer HUD and enable 'Frames Per Second.' This will trigger the display of framecount values, as well as a warning that shows whether a transaction was out of budget. | |||
Refer to: http://benoitgirard.wordpress.com/2014/08/29/visual-warning-for-slow-b2g-transaction-landed/ for more info. | |||
Also note, the red rectangle that appears on the top right corner means the system uses sync scrolling, instead of APZC. Refer to [https://bugzilla.mozilla.org/show_bug.cgi?id=1053992 bug 1053992] for more info. | |||
== Find the Pixel Ratio == | |||
In WebIDE, Runtime choose your device(it needs to turn on the debugging via USB from device in Developer's page of Settings app) then Open the system app. In the console tab, enter "window.devicePixelRatio" in command line to get the pixel ratio of screen. | |||
<gallery> | |||
File:PixelRatio.jpeg | |||
</gallery> | |||
= Scripts = | = Scripts = | ||
| Line 337: | Line 384: | ||
** Leo: take out battery, hold down volume button, plug into computer | ** Leo: take out battery, hold down volume button, plug into computer | ||
** see : http://source.android.com/source/building-devices.html#booting-into-fastboot-mode for other devices into fastboot mode | ** see : http://source.android.com/source/building-devices.html#booting-into-fastboot-mode for other devices into fastboot mode | ||
** Tarako: reboot, hold volume up | |||
* upload mode (visual screen change): | * upload mode (visual screen change): | ||
| Line 445: | Line 493: | ||
== COMRIL vs MOZRIL checking == | == COMRIL vs MOZRIL checking == | ||
* changes were made in COMRIL, that should be available in AU 112(v 1.0.1)/AU 103 (for v1.1) and beyond, where if the comril fails, it fails over to the mozril. You must have ril debugging turned on in the preference. See https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks#Changing_preferences | * changes were made in COMRIL, that should be available in AU 112(v 1.0.1)/AU 103 (for v1.1) and beyond, where if the comril fails, it fails over to the mozril. You must have ril debugging turned on in the preference. See https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks#Changing_preferences | ||
** |adb logcat | ** With Gecko RiL debugging enabled in Developer Settings, run |adb logcat| , if QContentHelper is present you are on COM RiL, otherwise you're utilizing MozRiL | ||
== Dealing with the Commercial RIL == | == Dealing with the Commercial RIL == | ||
| Line 537: | Line 584: | ||
== NFC == | == NFC == | ||
* Enable NFC log | * Enable NFC log (1) | ||
$ adb remount | $ adb remount | ||
$ adb pull /system/b2g/omni.ja | $ adb pull /system/b2g/omni.ja | ||
$ unzip omni.ja -d Omni | $ unzip omni.ja -d Omni | ||
$ | $ sed -i 's/this.DEBUG_ALL = false;/this.DEBUG_ALL = true;/g' Omni/modules/nfc_consts.js | ||
$ cd Omni | $ cd Omni | ||
$ zip -r omni.ja * | $ zip -r omni.ja * | ||
$ adb push omni.ja /system/b2g | $ adb push omni.ja /system/b2g | ||
$ adb reboot | $ adb reboot | ||
* Enable NFC log (2) | |||
Settings -> Developer -> NFC output in ADB | |||
* How to check if phone ever been suspend mode | |||
$ adb shell dmesg | |||
Keywords: | |||
'''<6>[ 109.614777] msm_pm_enter: power collapse''' | |||
<6>[ 109.614777] msm_pm_enter: return | |||
<6>[ 109.615516] Enabling non-boot CPUs ... | |||
<6>[ 109.621578] CPU1 is up | |||
<6>[ 109.625297] PM: noirq resume of devices complete after 3.675 msecs | |||
<6>[ 109.630210] PM: early resume of devices complete after 3.334 msecs | |||
<6>[ 109.632733] mmc1: slot status change detected (0 -> 1), GPIO_ACTIVE_LOW | |||
<6>[ 109.634477] as3647 2-0030: Resuming AS364X | |||
<6>[ 109.714609] PM: resume of devices complete after 84.359 msecs | |||
<6>[ 109.718752] Restarting tasks ... done. | |||
<6>[ 109.721717] PM: suspend exit 2014-07-31 00:15:52.031242786 UTC | |||
<6>[ 109.721750] PM: suspend entry 2014-07-31 00:15:52.031280129 UTC | |||
<6>[ 109.721760] PM: Syncing filesystems ... done. | |||
<6>[ 109.723166] Freezing user space processes ... (elapsed 0.01 seconds) done. | |||
<6>[ 109.743083] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done. | |||
<6>[ 109.763799] Suspending console(s) (use no_console_suspend to debug) | |||
<6>[ 109.799106] as3647 2-0030: Suspending AS364X | |||
'''<6>[ 109.806458] PM: suspend of devices complete after 37.257 msecs''' | |||
== WIFI == | |||
* How to setup wifi environment with EAP-SIM/EAP-TTLS/EAP-PEAP/EAP-TLS enabled | |||
Required equipments: | |||
* One Access Points with Radius supported | |||
* Card reader for reading SIM card | |||
* One desktop with Ubuntu for radius server | |||
* Wifi Environment setup: | |||
** Follow the "Compile freeradius with EAP-SIM/AKA support" section in http://bit.ly/1guIKyb to setup freeradius server in ubuntu 12.04. | |||
** Add below information in /etc/freeradius/users | |||
"sqa" Cleartext-Password := "password" | |||
Service-Type = Administrative-User, | |||
Reply-Message = "Radius Login Success" | |||
** The IMSI read by SIM card reader is 15 digits. Take 466923003314697 as an example. | |||
In simtriplets, the format of IMSI should be 1+IMSI+@wlan.mnc092.mcc466.3gppnetwork.org. So, it will be 1466923003314697@wlan.mnc092.mcc466.3gppnetwork.org. | |||
** After above steps, the | |||
/etc/freeradius/simtriplets.dat, | |||
/etc/freeradius/clients.conf, | |||
/etc/freeradius/sites-available/default, | |||
/etc/freeradius/eap.conf , | |||
and /etc/freeradius/users | |||
are all configured. | |||
** The EAP-SIM, EAP-TTLS, EAP-PEAP are all enabled. | |||
** Start the freeradius server. | |||
$ sudo /usr/sbin/freeradius -X | |||
* Steps to enable EAP-TLS | |||
** 1. Generate CA files | |||
$ cd /usr/lib/ssl/misc/ | |||
$ su | |||
$ ./CA.pl -newca, follow the steps to generate certificate in ./demoCA directory | |||
$ cd /demoCA | |||
$ openssl x509 -outform der -in cacert.pem -out cacert.crt => This CA certificate can be installed in devices. | |||
** 2. Generate server side certificate | |||
$ openssl req -new -nodes -keyout srv_key.pem -out srv_req.pem -config ../openssl.cnf | |||
$ openssl ca -config ../openssl.cnf -policy policy_anything -out srv_cert.pem -infiles ./srv_req.pem | |||
$ cat srv_key.pem srv_cert.pem > srv_keycert.pem | |||
** 3. Generate client side certificate | |||
$ openssl req -new -keyout cli_key.pem -out cli_req.pem -config ../openssl.cnf | |||
$ openssl ca -config ../openssl.cnf -policy policy_anything -out cli_cert.pem -infiles ./cli_req.pem | |||
$ openssl pkcs12 -export -in cli_cert.pem -inkey cli_key.pem -out cli_cert.p12 -clcerts | |||
** 4. Generate 2 required files that TLS needs | |||
$ openssl dhparam -check -text -5 512 -out dh | |||
$ dd if=/dev/urandom of=random count=2 | |||
** 5. put srv_keycert.pem in default cert directory of freeraidus. In this example, the directory is /etc/freeradius/certs | |||
** 6. put cacert.pem in default cert directory of freeraidus. In this example, the directory is /etc/freeradius/certs | |||
** 7. put dh & random files in default cert directory of freeradius | |||
** 8. Modify the below information in /etc/freeradius/eap.conf | |||
private_key_password = whatever (the one you input in generating certificate) | |||
private_key_file = ${certdir}/srv_keycert.pem (the output of STEP 2) | |||
certificate_file = ${certdir}/srv_keycert.pem (the same as above) | |||
CA_file = ${cadir}/cacert.pem (this file is in demoCA/) | |||
dh_file = ${certdir}/dh (the output of STEP 4) | |||
random_file = ${certdir}/random (the output of STEP 4) | |||
** 9. Restart freeradius server | |||
$ sudo /usr/sbin/freeradius -X | |||
** 10. Upload a CA certificate to device, this certificate can be used by EAP-TTLS/PEAP | |||
- $ adb push /usr/lib/ssl/misc/demoCA/cacert.crt /sdcard/Download (generate in STEP 1) | |||
- Goto Settings -> Location & Security -> Install from SD card on android device | |||
- Click on cacert.crt file | |||
- Enter a name for this certificate | |||
** 11. Configure device to Test EAP-TLS | |||
Install a user certificate | |||
- $ adb push /usr/lib/ssl/misc/cli_cert.p12 /sdcard/Download (generate in STEP 3) | |||
- Goto Settings -> Location & Security -> Install from SD card on android device | |||
- Click on cli_cert.p12 file | |||
- Enter the password to extract the certificates when prompted | |||
== Cellbroadcast == | |||
* Cellbroadcast and CMAS currently can be tested by emulator. | |||
** [[https://wiki.mozilla.org/FirefoxOS/QA/Cellboardcast| How to test]] | |||
= Building Gecko/Gaia = | = Building Gecko/Gaia = | ||
| Line 622: | Line 769: | ||
=== Other Gaia compilation commands === | === Other Gaia compilation commands === | ||
* MOZ_APPROX_LOCATION=1 | |||
** turn on privacy panel | |||
* MOZILLA_OFFICIAL=1 | * MOZILLA_OFFICIAL=1 | ||
** to make branded; default 0 | ** to make branded; default 0 | ||
| Line 645: | Line 794: | ||
See : https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Build_System_Primer | See : https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Build_System_Primer | ||
Also see : https://developer.mozilla.org/en-US/Firefox_OS/Customization_with_the_.userconfig_file | |||
and https://github.com/mozilla-b2g/gaia/blob/master/Makefile#L489 | |||
==== Profiles ==== | ==== Profiles ==== | ||
From kgrandon: {{bug|864751}} | From kgrandon: {{bug|864751}} | ||
| Line 695: | Line 845: | ||
See more info in the readme for the distribution_tablet: | See more info in the readme for the distribution_tablet: | ||
https://github.com/mozilla-b2g/gaia/blob/master/distribution_tablet/README.md | https://github.com/mozilla-b2g/gaia/blob/master/distribution_tablet/README.md | ||
More info on tablet building, etc : [ from Asa ] <br> | |||
* https://wiki.mozilla.org/FirefoxOS/TCP/Patching | |||
** You will find other Flatfish contributors in #TCP on IRC and more docs one level up from the link. | |||
== Generate Gaia/Gecko OTA Update Package == | == Generate Gaia/Gecko OTA Update Package == | ||
| Line 727: | Line 881: | ||
# git clone https://github.com/mozilla-b2g/B2G.git | # git clone https://github.com/mozilla-b2g/B2G.git | ||
# cd tools | # cd tools | ||
# Right before the bug reproduces, run " | # Right before the bug reproduces, run "./get_about_memory.py" | ||
# Zip up the directory that was generated & attach it to the bug | # Zip up the directory that was generated & attach it to the bug | ||
(Note: bug 1057565 allows us not to need MOZ_IGNORE_NUWA_PROCESS=1 anymore ) | |||
== More Information == | == More Information == | ||
| Line 830: | Line 986: | ||
= Misc = | = Misc = | ||
* Android Tethering might not necessarily work with Mac due to missing drivers. A resolution for this is HoRNDIS: | * Android Tethering might not necessarily work with Mac due to missing drivers. A resolution for this is HoRNDIS: | ||
http://www.joshuawise.com/horndis#available_versions | ** http://www.joshuawise.com/horndis#available_versions | ||
* Other Useful tips for third party webapp dev: | |||
** https://developer.mozilla.org/en-US/Apps/Build/App_development_FAQ#What_are_useful_commands_during_development.3F | |||
== backup and restoring contacts, music, etc. == | |||
* There's an app in the marketplace that helps do this: | |||
https://marketplace.firefox.com/app/pcsync | |||
== verifying patches before they land for gaia == | |||
From bug 1134649: just to note, this is an example of one way to verify patches before they land on a branch. Make sure you have space on the hard drive for the code, patch and building before attempting. <br> | |||
<br> | |||
In order to verify that the patch works: <br> | |||
# flash a flame with the latest 2.2 eng build | |||
#*reason: to get the latest gonk/gecko ; engineering build as it has root access and simplifies things. | |||
# git clone -b v2.2 https://github.com/mozilla-b2g/gaia.git v2.2_gaia_git | |||
#*reason: need to get the latest gaia for v2.2, -b v2.2 signifies the branch; if you already have a gaia 2.2, then just do a "git pull" on it. v2.2_gaia_git is somewhat arbitrary. you can have a different name, just keep it consistent with the next line ( cd ) | |||
# cd v2.2_gaia_git | |||
# git checkout -b fix-clock-load | |||
#* reason: branch out to a different branch to pull the patch in in case we need to reuse this local repo; this also autoswitches you to that branch after creating the branch. you can verify with: git branch ; fix-clock-load is arbitrary. You can have it different like bug_1134649 | |||
# git pull https://github.com/mcav/gaia.git fix-clock-load | |||
#* reason: need to pull mcav's fix; should be fine so long as he didn't make any changes on top of this fix in the branch. Otherwise you would have to cherry pick the fix. That might be a separate wiki entry... | |||
# save the commit, if you're in vi then 'esc' :wq | |||
#* reason : 'esc' key then :wq will save the commit, we just need to save a comment and the patch locally. | |||
# MOZILLA_OFFICIAL=1 make install-gaia | |||
#* reason: to build and install gaia on the device. This assumes that your flame device is connected, awake, no screenlocked and has adb access. MOZILLA_OFFICIAL=1 is only to brand it mozilla. There's no real need to do the MOZILLA_OFFICIAL=1. | |||
== General Testing on Mobile devices == | |||
https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks_Part2 | |||