Crosswalk – Crodova Command Line Compatibility

Cordova Command-Line Interface is about using “cordova” command. It is a node script that is installed in the host machine. In my case : /usr/local/bin/cordova.

cordova command works based on Cordova generated directory structure. Therefore, it doesn’t work for Crosswalk directory structure. To build and run, instead of using cordova command, we need to use the scripts inside projectname/cordova directory, which was in projectname/platforms/android/cordova in case of Cordova project. To create Crosswalk project, there is a new node script made by Crosswalk team : create. And for managing Crodova Plugins, low level plugin utility, plugman is used.

Followings are matching functionalities of cordova. ./create script is in bin directory of Crosswalk-Cordova distribution, and other commands are executed in the project directory. For example, ./cordova/run is projectname/cordova/run file.

function platform command / explanation
create Project Cordova $cordova create hello com.example.hello HelloWorld
Crosswalk $./create hello com.example.hello HelloWorld
./create is inside the bin directory of Crosswalk-Cordova distribution
build prepare Cordova $cordova prepare
Crosswalk NA
copying resource from www directory to platform directory
compile Cordova $cordova compile
Crosswalk NA
compiling without copying
build Cordova $cordova build
Crosswalk $./cordova/build
prepare + compile. options are the same. eg) –debug –release
run Cordova $cordova run
Crosswalk $./cordova/run
build + run. options are the same. eg) –nobuild –emulator
version Cordova $cordova –version
Crosswalk $./cordova/version
project info Cordova $cordova info
Crosswalk NA
platform Cordova $ cordova platform add/ls/update
Crosswalk NA – Crosswalk-Android is only for Android and it already contains a skeleton Android project

Followings are plugin management functionalities. plugman is used instead of cordova plugin.
plugman is basically a tool to create/manage/upload Cordova plugins.
Full functionalities : link.

function platform command / explanation
adding plugin Cordova $cordova plugin add cordova-plugin-name
Crosswalk $plugman install –platform android –project . –plugin cordova-plugin-name
deleting plugin Cordova $cordova plugin rm cordova-plugin-name
Crosswalk $plugman uninstall –platform android –project . –plugin cordova-plugin-name
listing plugin Cordova $cordova platform ls
Crosswalk NA
searching plugin Cordova $cordova plugin search plugin-keyword
Crosswalk $plugman search plugin-keyword

Followings are scripts supported by Crosswalk that are in bin directory of Crosswalk-Cordova distribution

command explanation
$./create options used to create a Crosswalk project
$./update project_directory it calls create script again and it updates the project to newest version.
$./check_reqs check if there is no problem in Crosswalk build environment
it shows “Looks like your environment fully supports cordova-android development!”
$./android_sdk_version shows installed Android sdk version.



Crosswalk – Cordova Plugins Compatibility 2

In the previous posting about “Crosswalk-Cordova Plugins Compatibility”, I introduced compatibility table. However, the table was for Crosswalk 7; stable Crosswalk version when I started to use Crosswalk was 9. Because there was no more compatibility table from Crosswalk, I had to check if current Cordova Plugins work properly on Crosswalk-Android application.
I tested major plugins that are necessary to make Cordova apps.

Test Order

  1. Choosing a Cordova Plugin from
  2. Testing the plugin at a Cordova app
    • Creating Cordova App using : cordova create testapp com.cordova.testapp testapp
    • Adding the plugin using : cordova plugin add org.apache.cordova.pluginname
    • Making a sample HTML/Javascript app using sample codes on Cordova plugin page, Adobe PhoneGap API Reference, and internet searching result.
    • Adding permission to : platforms/android/AndroidManifest.xml
    • Testing it on the phone using : cordova run android
  3. Testing the plugin at a Crosswalk app
    • Creating Crosswalk App using : ./create testapp com.crosswalk.testapp testapp
    • Adding the plugin using : plugman install --platform android --project . --plugin gitrepo
    • Coping the sample app worked on Crodova to project_directory/assets/www
    • Adding permission to : project_directory/AndroidManifest.xml
    • Testing it on the phone using : ./cordova/run

Versoin of tested Cordova/Crosswalk-Cordova Issue

  • Cordova : 3.6.4
  • Crosswalk-Cordova :
    • Cordova used by Crosswalk : 3.5.1
  • Crosswalk-Cordova :
    • Cordova used by Crosswalk : 3.6.3

When I tested File-Transfer plugin, this caused annoying problem. The code working on the Cordova didn’t work with an error code on Crosswalk app. By using recently updated Crosswalk-Cordova stable version(, I could get the same result.

Test Result

Simply, every Plugin I tested worked well in Crosswalk.

Plugin Installation Work O/X
Device $ cordova plugin add org.apache.cordova.device O
$ plugman install –platform android –project . –plugin O
Console $ cordova plugin add org.apache.cordova.console O
$ plugman install –platform android –project . –plugin O
Battery Status $ cordova plugin add org.apache.cordova.battery-status O
$ plugman install –platform android –project . –plugin O
Camera $ cordova plugin add O
$ plugman install –platform android –project . –plugin O
taking picture, selecting from local gallery worked well
Contacts $ cordova plugin add org.apache.cordova.contacts O
$ plugman install –platform android –project . –plugin O
listing contacts, adding new entry worked well
Device Motion (Accelerometer) $ cordova plugin add org.apache.cordova.device-motion O
$ plugman install –platform android –project . –plugin O
Device Orientation (Compass) $ cordova plugin add org.apache.cordova.device-orientation O
$ plugman install –platform android –project . –plugin O
Dialogs $ cordova plugin add org.apache.cordova.dialogs O
$ plugman install –platform android –project . –plugin O
FileSystem $ cordova plugin add org.apache.cordova.file O
$ plugman install –platform android –project . –plugin O
file/folder listing/reading/writing worked well
FileTransfer $ cordova plugin add org.apache.cordova.file-transfer O
$ plugman install –platform android –project . –plugin O
fileEntry.fullPath didn’t work for both. cordova.file.dataDirectory is the way to get downloadable path.
in version, method failed with error code 3(CONNECTION_ERR), it worked in
I didn’t test file uploading.
Geolocation $ cordova plugin add org.apache.cordova.geolocation O
$ plugman install –platform android –project . –plugin O
Media $ cordova plugin add O
$ plugman install –platform android –project . –plugin O
Remote audio file playback/pause/stop worked well
Network Information $ cordova plugin add O
$ plugman install –platform android –project . –plugin O
Connection type 3G/4G/Wifi. Worked well
Vibration $ cordova plugin add org.apache.cordova.vibration O
$ plugman install –platform android –project . –plugin O

Permissions used in AndroidManifest.xml

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-feature android:name="" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="" />
    <uses-permission android:name="android.permission.BATTERY_STATS" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />


  • All plugins I tested were working the same way in both Cordova and Crosswalk.
  • When I installed plugins, I didn’t specify plugin’s version because the aim of this testing was to know if current version of plugins are working on current version of Crosswalk. However, current Cordova version and the version of Cordova module that are used in stable Crosswalk was different.
  • When the application use a plugin, if it doesn’t work properly, it needs to be checked if it works properly in the Cordova application that use the same Cordova module version.
  • FileTransfer plugin worked differently depending on Cordova version. However, in most recent version, works well. According to web search result, there were several report about error code 3. One solution is adding header (Connection:”close”) from this link.
  • I didn’t test all property/method of plugins. Therefore, there might be some functions that works differently.
  • There are 740 plugins so far. To use it, testing is necessary. I tested only 14 plugins.

Crosswalk – Cordova plugins compatibility

Adding Cordova Plugin to the Cordova project.

$ cordova create Testproject com.test Testproject
$ cordova platform add android
$ cordova plugin add

After making Crodova project, Android platform need to be added. And then, plugins are added.
All of them work with the cordova command.

Adding Cordova Plugin to the Crosswalk-Cordova project

$ ./create Testproject org.crosswalkproject.sample Testproject
$ sudo npm install -g plugman
$ plugman install --platform android --project . \

Using first command, Crosswalk-cordova for Android project is created.
“platform add android” doesn’t need to be done because this is only for Android so it already contains an android project.
According to the instruction, to add cordova plugin to Crosswalk project, another tool called “plugman” is used. Second command is to install it using npm(NodeJS Package Manager).
Third command is to add a cordova plugin’s particular version using plugman. However, plugman is from cordova project and it is basically the same as “cordova plugin add“. Although plugman is plugin management tool and it seems to have more functionality, I guess there will be no difference in terms of adding a plugin.

Crodova – Crosswalk plugin compatibility
Technically, Cordova plugins should work in Crosswalk Cordova. However, Crosswalk reports plugin compatibility lists. Which means a Crosswalk distribution is tested for particular plugin version.
Crosswalk Cordova for Android: plugin compatibility lists

Following table is for Crosswalk Cordova 7; Current stable version is

API Installation URL Notes
Battery Status
Device Motion (Accelerometer)
Device Orientation (Compass)
File Transfer
Geolocation Recommend to use Crosswalk’s geolocation API
Media Install File Plugins before this one
Media Capture Install File Plugins before this one
Network Information (Connection)

Next Step
– Testing another plugins except core plugins listed in compatibility list. (709 plugins)
This page says AdMob plugin and IAP plugin are also used in Crosswalk Android. What make it possible need to be examined.
– Compatibility list shows only until Crosswalk 7. Current stable version is 10. Most recent compatibility list need to be checked.
– Cordova command line interface and crosswalk command line compatibility check (list need)

CordovaStabilizer – Crosswalk in Blackberry 10

Conclusion is “Crosswalk doesn’t work in Blackberry 10”.

Blackberry 10 support installing apk file.

I sent sample crosswalk apk file by email and tried to install.

Screenshot from 2015-01-14 17:31:19

Screenshot from 2015-01-14 17:32:40

Screenshot from 2015-01-14 17:37:55

It seemed installed successfully; but, when I ran it, shows CPU architecture mismatch error.

The apk I installed was ARM version, so I made intel version crosswalk app.

Intel version apk size is slightly bigger.

Screenshot from 2015-01-14 17:48:42

Result was the same : CPU architecture mismatch error.

Crosswalk is basically for Android and Tizen.
For Blackberry, Cordova with stock webview will be the solution.

Next step : testing Cordova in Blackberry.

CORDOVASTABILIZER – Blackberry 10 simulator for Linux

To test corsswalk and cordova app in Blackberry 10, I installed Blackberry simulator on Linux (Ubuntu 14.04 LTS)

1. Installing the simulator
When download setup file from this URL for Linux and setup, in ~/VMImages/BlackBerry10Simulator-BB10_3_1-995 folder, there are bunch of .vmdk and .vmx files including BlackBerry10Simulator.vmx. These files are VMWare image files.

2. Installing VMWare Player

3. Run the simulator through VMWare Player
Run VMWare Player and open BlackBerry10Simulator.vmx and run.

Screenshot from 2015-01-14 16:16:38

4. Connect the controller to the simulator
Run controllers/controller in installed directory using terminal

hosung@hosung-Spectre:~/VMImages/BlackBerry10Simulator-BB10_3_1-995$ controllers/controller 

Screenshot from 2015-01-13 17:41:46

Using the controller, can simulate getting phone calls and various things like above.

CordovaStabilizer – Research Crosswalk 4 – Architecture

Crosswalk VS Cordova

  • Cordova is a set of device APIs for multiple mobile OS and it uses default WebView of each OS.
  • Crosswalk is Chromium browser based HTML5 application wrapper for Android and Tizen.


Crosswalk supports three kinds of architectures.

1. Crosswalk Application

This is default Crosswalk app that that made by HTML5, Javascript, and CSS, and it supports only Android and Tizen. Crosswalk API is a standard API set. Crossswalk has no hardware API on their own.
Crosswalk Extension is native Java code block that can communicate with HTML part.

  • Pros : HTML5 features in old Android OS, Shared mode WebView distribution
  • Cons : Only supports Android and Tizen, No native H/W access
  • Usage : HTML5 App for Android and Tizen

2. Crosswalk WebView Application
Because Crosswalk is basically Chromium Browser, it can work as a WebView of Native Android App instead of stock WebView of Android.

  • Pros : HTML5 features in old Android OS, can be mixed with native app
  • Cons : only for Android
  • Usage : Native + HTML app for Android

3. Crosswalk-Cordova Application
This is an implementation of Cordova-enabled WebView component. When the user create Crosswalk-Cordova template using a node script, the template include Android app project that include Android Activity implementation of CordovaInterface. In this case, HTML5 app can use all device APIs of Cordova and use both Crosswalk Extension and Cordova Plugin for native java code.

  • Pros : HTML5 features in old Android OS, Can use Cordova device APIs
  • Cons : Only for Android, Big apk size (starts from 19MB)
  • Usage : HTML5 app for Android

4. Crosswalk-Cordova Application 2 (need test)
Basically the same as before. The difference is using only Cordova Plugin for native Java code and avoiding using Crosswalk only features. If so, the same HTML source code can work for devices supported by Cordova. Crosswalk WebView works for Android, and for other OS, stock WebView is used.

  • Pros : HTML5 features in old Android OS, Can use Cordova device APIs, work for other OS
  • Cons : Big apk size (starts from 19MB)
  • Usage : HTML5 Cordova app that supports various Mobile OS

Although HTML code and Cordova Plugin code is the same, build environment will be varied depending on OS.

CordovaStabilizer – Research Crosswalk 3

In previous posting, I tested Crosswalk-Cordova. Today, I tested Crosswalk app shared mode.

1. Linux Development Environment Setup

Currently Crosswalk officially supports Windows and Linux, not Mac yet.
instruction : Linux host setup

This instruction is about installation of Python, Oracle JDK, Ant, Android SDK, and Crosswalk template. In my case, every tool was already installed.
Following is my environment :

hosung@hosung-Spectre:~$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
hosung@hosung-Spectre:~$ ant -version
Apache Ant(TM) version 1.9.3 compiled on April 8 2014
hosung@hosung-Spectre:~$ python --version
Python 2.7.6
hosung@hosung-Spectre:~$ adb help
Android Debug Bridge version 1.0.32

2. Android target setup

instruction : Android target setup
Currently Crosswalk supports only Android and Tizen.
I made an Android 4.4.2 emulator with Intel Atom(x86) and GPU Emulation.

3. Building an HTML5 application

instruction : Building a Crosswalk application

I made only 3 files in a directory.

├── icon.png
├── index.html
└── manifest.json

index.html :

<!DOCTYPE html>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">
    <p>hello world 2</p>

manifest.json :

  "name": "simple2",
  "xwalk_version": "",
  "start_url": "index.html",
  "icons": [
      "src": "icon.png",
      "sizes": "128x128",
      "type": "image/png",
      "density": "4.0"

4. Packaging apk using embeded mode

instruction : Running a Crosswalk app on Android

Build :

hosung@hosung-Spectre:~/development/crosswalk-$ python --package=org.crosswalkproject.example --manifest=/home/hosung/cdot/Sample/xwalk-simple/manifest.json
Use xwalk's keystore by default for debugging. Please switch to your keystore when distributing it to app market.

Total time: 27 seconds
Use xwalk's keystore by default for debugging. Please switch to your keystore when distributing it to app market.

Total time: 12 seconds
An APK for the web application "Example" including the Crosswalk Runtime built for x86 was generated successfully, which can be found at
An APK for the web application "Example" including the Crosswalk Runtime built for arm was generated successfully, which can be found at

2 APKs were created for x86, arm devices. 
Please install the one that matches the processor architecture of your device.

If you are going to submit this application to an application store, please make sure you submit both packages.
Instructions for submitting multiple APKs to Google Play Store are available here:

Output file :

Example_0.0.0.1_arm.apk : 16.7 Mib
Example_0.0.0.1_x86.apk : 19.6 Mib

Installing on 4.4.2 device

hosung@hosung-Spectre:~/cdot/Sample/xwalk-simple$ adb install -r Example_0.0.0.1_arm.apk 
5435 KB/s (17475022 bytes in 3.139s)
	pkg: /data/local/tmp/Example_0.0.0.1_arm.apk

Installing on Android 4.4.2 Intel Atom(X86) Emulator

hosung@hosung-Spectre:~/cdot/Sample/xwalk-simple$ adb install -r Example_0.0.0.1_x86.apk 
7175 KB/s (20519911 bytes in 2.792s)
WARNING: linker: has text relocations. This is wasting memory and is a security risk. Please fix.
	pkg: /data/local/tmp/Example_0.0.0.1_x86.apk

Both apks for both device installed and worked well.

5. Packaging apk using shared mode

instruction : Running a Crosswalk app on Android – the same as previous link

Shared mode use –mode=shared option
Build :

hosung@hosung-Spectre:~/development/crosswalk-$ python --mode=shared --package=org.crosswalkproject.simple2 --manifest=/home/hosung/cdot/Sample/xwalk-simple/manifest.json
Use xwalk's keystore by default for debugging. Please switch to your keystore when distributing it to app market.
   [subant] No sub-builds to iterate on

Total time: 4 seconds
A non-platform specific APK for the web application "Simple2" was generated successfully at
/home/hosung/development/crosswalk- It requires a shared Crosswalk Runtime to be present.

Output file :

Simple2_0.0.0.1.apk : 65.3KiB

This small apk is for both x86 and ARM. The instruction says : In shared mode packaging, each web app is bundled with a thin layer of Java code which is architecture-independent.
To run this app, the Crosswalk runtime for each CPU need to be installed.

I tried to install and run without the runtime.

Installing :

hosung@hosung-Spectre:~/development/crosswalk-$ adb install -r Simple2_0.0.0.1.apk 
4078 KB/s (66912 bytes in 0.016s)
WARNING: linker: has text relocations. This is wasting memory and is a security risk. Please fix.
	pkg: /data/local/tmp/Simple2_0.0.0.1.apk

Installing was successful, but when I ran it it showed :
When I touched “Install From Store”, the app stopped like second image.
And then, I installed it in the Android 4.4.2 device (ARM).
This time when I touched “Install From Store”, it opened Google Play but couldn’t find the runtime.

I downloaded Crosswalk runtime

size : XWalkRuntimeLib.apk : 16.7 Mib

size : XWalkRuntimeLib.apk : 19.6 Mib

And installed the runtime to X86 emulator

hosung@hosung-Spectre:~/development/crosswalk-runtime/crosswalk-apks-$ adb install -r XWalkRuntimeLib.apk 
7486 KB/s (20559803 bytes in 2.681s)
WARNING: linker: has text relocations. This is wasting memory and is a security risk. Please fix.
	pkg: /data/local/tmp/XWalkRuntimeLib.apk

The app worked successfully.

For ARM phone :

hosung@hosung-Spectre:~/development/crosswalk-runtime/crosswalk-apks-$ adb install -r XWalkRuntimeLib.apk 
5069 KB/s (17473893 bytes in 3.365s)
	pkg: /data/local/tmp/XWalkRuntimeLib.apk

The app worked successfully.

Crosswalk support embedded mode and shared mode. Embedded mode bundles Cromium WebView in the app, and in this case, big-size apks for x86 and ARM must be distributed separately. Shared mode needs only one small-size apk for both x86 and ARM devices, but Crosswalk runtime must be installed beforehand. If there is no runtime in the device, there is a way to redirect to store to install it.
The apps today I tested were Crosswalk app. It is different from Crosswalk-Cordova. It did not use Cordova. Next post will deal with this issue.