A Command Line Inteface for generating Android native apps from open webapps
Перейти к файлу
Myk Melez d12449d694
note that project is archived
2019-06-20 11:02:44 -07:00
bin Parse manifestOrPackage and if it is a url, set the manifest override. Fixes issue #83 2015-07-28 06:39:20 -07:00
docs Change order of steps to be more readable 2014-07-07 17:00:04 -07:00
lib Created from apk-factory-service code 2014-04-23 17:06:28 -07:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file 2019-03-28 21:56:38 -07:00
README.md note that project is archived 2019-06-20 11:02:44 -07:00
package.json Version 0.0.10 for release 2015-07-29 07:27:02 -07:00

README.md

Note: this project has been archived, as development has stalled, and it isn't being actively maintained, nor used.

APK CLI

A Command Line Interface for generating Android native apps from open webapps.

These are mainly for testing and not for distribution. Use the APK Factory Service for distributable .apk files.

Getting started

This tool requires NodeJS, zip, and unzip.

npm install mozilla-apk-cli

You will now have mozilla-apk-cli installed in node_modules/.bin.

(You can do npm install -g mozilla-apk-cli to install this command system wide)

Usage

Usage: ./node_modules/.bin/mozilla-apk-cli {OPTIONS} manifestOrPackagedApp testable.apk

Hosted App:             mozilla-apk-cli {OPTIONS} http://example.com/manifest.webapp testable.apk
Packaged App Zip:       mozilla-apk-cli {OPTIONS} package.zip testable.apk
Packaged App Dir:       mozilla-apk-cli {OPTIONS} ./www testable.apk

mozilla-apk-cli can accept either a manifest url, a zip file, or a directory which contains the source code for a packaged app.

Typical usage will not require any OPTIONS.

Options:
  --overrideManifest  Treat this manifest url as the canoncial url while
                  creating the apk                                          
  --endpoint          The URL for the APK Factory Service
                      [default: "https://controller-review.apk.firefox.com"]
  --help, -?          Display this message                                      
  --config-files      Comma seperate file paths

Note: Do not upload this .apk into the Google Play store. Do not distribute this as a released Android app through your own website. You're users will not be able to get updates to your app.

Installation problems?

If you are using Windows and get errors, check out these Windows notes.

Installing the .apk

Now that you have a .apk file, you need to install it on your Android device.

There are two main ways:

  1. Setup adb and install to your device

    adb install test.apk

If adb is setup correctly, the app should now appear in your list of installed apps. To push an updated .apk, you must un-install before running this command a second time.

  1. Request it from a web browser

    python -m SimpleHTTPServer

Figure out your IP Address and point your Android's browser at http://192.168.0.13:8000/test.apk or whatever

Relaunching the .apk

  1. Find out your package name

    adb lolcat

Kill you app and then make it run. Look for:

I/ActivityManager(  612): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.firefox.cli.apk.packagedozten.p3ea7a6153641373b9751d2e48430c43f/org.mozilla.android.synthapk.LauncherActivity} from pid 913 

From this we can wee the packag ename is com.firefox.cli.apk.packagedozten.p3ea7a6153641373b9751d2e48430c43f

$ adb shell
# am start -a android.intent.action.MAIN -n com.firefox.cli.apk.packagedozten.p3ea7a6153641373b9751d2e48430c43f/org.mozilla.android.synthapk.LauncherActivity

Which is

# am start -a android.intent.action.MAIN -n ${PACKAGE_NAME}/org.mozilla.android.synthapk.LauncherActivity