Version: Smart Feature Phone 2.5

OS ENV Setup

Instructions for users who have access to a debug device

Windows

Install Firefox

Download firefox v59 before installing make sure the previous version of firefox is uninstalled.

Disabling auto updates once Firefox is installed. (Menu -> options -> general)

win-firefox-config

Install ADB

  1. Visit this Google page to Download the ADB ZIP file for Windows.

  2. Unzip the folder on your Windows C Drive (C:\platform-tools).

Connecting to Device

  1. Connect your device with the laptop using USB cable. Make sure it is in debug mode.

  2. Open the Settings app and follow this flow:

Device > Developer > Debugger > ADB and DevTools

  1. Open command prompt of your laptop.

  2. Run

$ cd /path/to/extracted/folder/
  1. Run
$ adb devices

You should see your device has been detected.

  1. Run
$ adb root
$ adb forward tcp:6000 localfilesystem:/data/local/debugger-socket

This is to establish a path between your device and the laptop.

adb-windows
  1. Open Firefox Web IDE. Click on “Remote Runtime” on the right side. Press “OK”. A warning about old connected runtime version would pop up. Ignore it.

  2. You are ready to install an app on your device

Install your first app

  1. Open Firefox Web IDE and make sure you have connected your device and executed the commands
$ adb root
$ adb forward tcp:6000 localfilesystem:/data/local/debugger-socket
  1. If you have packaged app stored on your laptop, click “Open Packaged App” on the left side and select your project folder.

  2. Your project folder must have a manifest.webapp file. Otherwise, the IDE cannot open your app. Check here to create manifest.webapp file.

  3. After selecting your app, you should be able to see your app.

webide-windows-app
  1. Install the app on your device with RUN button and Debugger button to debug top center of WebIDE.

  2. Install the app.

  3. Then, you are available to use the basic tools in the web IDE for development, such as Inspector, Console, JavaScript Debugger, Style Editor, Scratchpad.

macOS

Install ADB

You can follow this link install ADB tools for macOS.

Install and Run app

  1. Download firefox v59

  2. open terminal and run these commands

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew cask install android-platform-tools

connect device and run

adb devices

You should see 1 device connected.

  1. disconnect from internet, install downloaded firefox, go to prefferences and disable updates (download or check): Connect to internet

  2. Go to about:config, turn the following preferences: xpinstall.signatures.required = false, extensions.legacy.enabled = true

  3. Go to this link and download install adb helper

  4. In Firefox Tools > Add on > Extension and add the downloaded adb_helper.xpi file

  5. In firefox go to Tools > Web Developer > WebIDE

  6. On right should see "USB Devices" and should have one device

  7. On the left have "Open Packaged App" - click it, and choose some app (a folder)

  8. Middle top click the play button... that's it, app should be on your phone and you should notice it.

Linux

Install Firefox

You will need to get the Firefox v59 or older version for KaiOS implementations, to download these versions, you can get them through Mozilla FTP.

After downloading the chosen version, you must unpack the package with the command:

$ tar jxvf firefox-*.tar.bz2 -C /opt

Create a shortcut to facilitate program execution

$ sudo ln -sf /opt/firefox/firefox /usr/bin/firefox

Setting WebIDE

Firefox's WebIDE is a necessary development tool to inspect your app, as well as see the console, debugger, and others.

  • Follow the instructions in WebIDE to setup and learn more about WebIDE.

Installing make(Optional)

Make is a necessary tool to run KaiOS. Execute the following commands on the terminal to install it.

$ wget http://ftp.us.debian.org/debian/pool/main/m/make-dfsg/make_3.81-8.2_amd64.deb
$ sudo dpkg -i make_3.81-8.2_amd64.deb
$ sudo apt-mark hold make

Setting the required architectures(Optional)

$ sudo dpkg --add-architecture i386
$ sudo dpkg --add-architecture amd64

Installing dependencies(Optional)

There are some necessary dependencies to complete your environment for running Gaia. Execute the command below on your terminal and all these dependencies will be installed.

$ sudo apt install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git lib32ncurses5-dev lib32z1-dev libgconf2-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip lzop libxml2-utils openjdk-8-jdk nodejs unzip python

Setting ccache(Optional)

$ ccache -M 10G

Installing ADB and fastboot

$ sudo apt install android-tools-adb android-tools-fastboot

Setting USB access

$ wget -S -O - https://raw.githubusercontent.com/cm-b2g/B2G/1230463/tools/51-android.rules | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
  • Plug the device in your computer using a USB cable

  • Use the command

$ lsusb

on the terminal to get the Vendor ID. Example of a result: Bus 001 Device 014: ID 22b8:2e76 Motorola PCS ===> vendor ID is 22b8

  • Log in as root and edit this file: /etc/udev/rules.d/51-android.rules

  • In the file above put a new line using the vendor ID that you got before. Example: SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"

  • Now execute:

$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
  • Create the following file in your HOME dir (not as root)
$ nano ~/.android/adb_usb.ini
  • Put the value of vendor ID on this file using hex format. Example: 0x22b8, where 22b8 is the vendor ID that you got before.

  • Use the command 'adb devices' on the terminal to list all devices connected on your PC. Your device should be listed and is ready to receive Gaia apps or use it on WebIDE.

Connection Errors

For more information about the ADB connection fail error see this link

This extension will re-enable extensions that were disabled on May 3, 2019 for Firefox versions 52 - 56.