Google has quit active development of cca. Therefor this plugin has been deprecated. Chrome apps can now be generated through ember-cli-deploy with the ember-cli-deploy-chrome-app package.
This Ember Addon provides commands to build your project as a chrome or cordova app, using Google's MobileChromeApps
Install the addon by running:
npm install ember-cli-mobile-chrome-apps
Run ember help
for a detailed list of all commands and arguments.
First generate the chrome app by running:
ember g chrome
This commands generates a folder apps
in the root of your project.
Both the chrome and cordova apps will appear in it.
In apps/chrome
you'll find background.js
and a default manifest.json
that you can change according to your needs. For more information about the manifest see this link.
You can add files and folders from your dist
to the chrome app by copying or symlinking them in the apps/chrome
directory.
window.html
and the assets
folder have already been added as a default.
This way you can manage which parts of your Ember CLI app will be added to your chrome app.
ember chrome:build
This command builds the chrome app from theapps/chrome
folder. It will generate aproject_name.zip
and a signedproject_name.crx
file inapps/chrome/dist
. You can specify the location of the key in theconfig/mobile-chrome-apps.js
file. The command will also build your ember cli project (you can skip this using--skip-build
or change the build environment using--environment
).
During development you don't have to build your project all the time, you can just go to chrome://extensions
with chrome and click 'Load unpacked extension'. Then choose the apps/chrome
folder and you'll see the app appear in chrome.
If you have a working chrome app you can add cordova by running:
ember g cordova
This will generate a manifest.mobile.json
file in apps/chrome
that contains your app's packageId
(for example com.example.ProjectName
). You can update this to your desired packageId.
It will also generate the apps/cordova
folder that contains the cordova project.
ember cordova:checkenv
Before being able to use cordova properly you should run this command to verify that you have set up your working environments for Android and iOS correctly.ember cordova:build
With this command you can build your cordova project and optionally--release
it.ember cordova:run
The run command can be used to emulate the app or deploy it to a developer device. For exampleember cordova:run --android --emulate
will emulate your android app.ember cordova:run --ios --device
will deploy the app to an iOS developer device.ember cordova:upgrade
This command can be used to upgrade your cordova project when a new version of google'scca
is being released. You'll also be prompted to do so when you build the app and there is an update.
- Both chrome and cordova apps seem not yet able to handle pushState. Make sure
locationType
is set tohash
in yourconfig/environment.js
file. - Depending on your configuration, you might need to disable fingerprinting. If you have symlinked
apps/chrome/window.html
todist/index.html
, the asset urls inapp/index.html
will be compiled like normal. However, if you have a different window.html, it will not be compiled and thus will not be able to handle fingerprinted assets. In that case you have to disable it inember-cli-build.js
by settingfingerprint
to{ enabled: false }
.
This project is released under the MIT License.