<commit_before>cordova-app-harness
===================

An App that can download and run Cordova apps.

Primary Goals:
* Super-fast edit &amp; refresh workflow
* Test on devices without needing platform SDKs

## Building the App Harness

TLDR - using a Unix environment, run:

    ./createproject.sh

The manual way:

1. Create a new CLI app:

        cordova create CordovaAppHarness com.yourcompany.appharness CordovaAppHarness

1. Add whichever platforms you want (currently only iOS and Android are supported by the underlying plugins: UrlRemap, zip):

        cordova platform add android ios

1. Add the following plugins:

    * `org.apache.cordova.UrlRemap` (exists in the `UrlRemap` directory)
    * `org.apache.cordova.file`
    * `org.apache.cordova.file-extras` (exists in cordova-labs right now)
    * `org.apache.cordova.file-transfer`
    * `com.phonegap.plugins.barcodescanner` (optional - adds barcode scanning)

1. Clone the the `cordova-app-harness` repository.
1. Copy the `www` directory into the project:

        rm -r CordovaAppHarness/www
        cp -a cordova-app-harness/www CordovaAppHarness/www
        cordova prepare

1. Add any plugins that your apps might need.

## Features
* Install and test multiple applications.
* In-App Menu to switch between installed apps.
* Firebug Lite and Weinre support for debugging.

## Major Unimplemented Installer Features
* Editing of URLs in the app list
* Incremental updates of `cordova serve` URLs (instead of re-downloading existing files)
* Install from `.crx` files
* Install from `.cdvh` files (created via packapp script)
* Detecting when an app requires a plugin that the harness doesn't have
* Detect version mismatches of app vs harness (report as warnings)

## Major Unimplemented Launcher Features
* Applying app settings (DisallowOverscroll, etc)
* Applying app splashscreen
* Applying app's whitelist
* Enabling only the plugins that the app has installed

## Major Unimplemented In-App Menu Features
* Inject a JSConsole script tag
* JSHybugger support
* Simulator-friendly menu gesture (shake gesture?)

## Test by using `cordova serve`
* Go to Cordova project of the app you want to test in a terminal and run.

      cordova serve <platform>

  * If you are running this on a simulator, you can use `http://localhost` as your address, or on Android `10.0.0.22`.
  * If `cordova serve` is on a different network than your App Harness, then use [ProxyLocal](http://proxylocal.com/) or [LocalTunnel](http://progrium.com/localtunnel/) to forward the port.

## Running an app in the harness
* Click launch on the installed app
* See if the app looks as expected
* Use a 3 finger tap to access the app menu while testing your app.
* The context menu that pops up allows you to return to the main screen, restart or update the app, open a Firebug console on the device, or set up remote debugging using Weinre.<commit_msg>Update README.md to reflect current project status<commit_after>cordova-app-harness
===================

An App that can download and run Cordova apps.

Primary Goals:
* Super-fast edit &amp; refresh workflow
  * E.g. have a `grunt watch` that pushes every time a file changes
  * E.g. have `livereload`-type functionality for CSS & images
* Test on devices without needing platform SDKs
  * E.g. develop for iOS on a Windows machine
  * Non-goal: Release to iOS from Windows

## Building the App Harness

TLDR - using a Unix environment, run:

    ./createproject.sh

The manual way:

1. Create a new CLI app:

        cordova create CordovaAppHarness com.yourcompany.appharness CordovaAppHarness

1. Add whichever platforms you want (currently only iOS and Android are supported by the underlying plugins: UrlRemap, zip):

        cordova platform add android ios

1. Add the following plugins:

    * `org.apache.cordova.UrlRemap` (exists in the `UrlRemap` directory)
    * `org.apache.cordova.file`
    * `org.apache.cordova.file-transfer`
    * `com.phonegap.plugins.barcodescanner` (optional - adds barcode scanning)

1. Clone the the `cordova-app-harness` repository.
1. Copy the `www` directory into the project:

        rm -r CordovaAppHarness/www
        cp -a cordova-app-harness/www CordovaAppHarness/www
        cordova prepare

1. Add any plugins that your apps might need.

## Features
* Install and launch via `cordova serve`
* Three-finger swipe to return to main menu

## Major Unimplemented Features
* Applying app settings (DisallowOverscroll, etc)
* Applying app splashscreen
* Applying app's whitelist
* Enabling only the plugins that the app has installed

## Major Unimplemented In-App Menu Features
* Inject a JSConsole script tag
* JSHybugger support
* Simulator-friendly menu gesture (shake gesture?)

## Test by using `cordova serve`
* Go to Cordova project of the app you want to test in a terminal and run.

      cordova serve <platform>

  * If you are running this on a simulator, you can use `http://localhost` as your address, or on Android `10.0.0.22`.
  * If `cordova serve` is on a different network than your App Harness, then use [ProxyLocal](http://proxylocal.com/) or [LocalTunnel](http://progrium.com/localtunnel/) to forward the port.

## Running an app in the harness
* Click launch on the installed app
* See if the app looks as expected
* Use a 3 finger swipe to access the app menu while testing your app.
* The context menu that pops up allows you to return to the main screen, restart or update the app, open a Firebug console on the device, or set up remote debugging using Weinre.
{'fraction_non_alphanumeric': 0.077492774566474, 'fraction_numerical': 0.004696531791907515, 'mean_word_length': 3.8570175438596492, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4749812', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1543, 'n_words': 721}