Converts an existing Cordova/Ionic project to a Crosswalk project. When the script is done running, you should have a fat 40MB APK file in platforms/android/ant-build
.
This assumes you have the following already installed: cordova
, ant
, android
, and that your ANDROID_HOME
is set to point to the Android SDK.
This will work on both x86 and ARM. If you want to build two separate APKs so that they're smaller, then modify the script; the script at least shows how it works.
Step 1: download the "Cordova Android" libraries from the Crosswalk downloads page. You don't need anything except for the "Cordova Android" ones.
Step 2 Unzip them both.
Step 3 Navigate to your project directory and run:
./prepare_crosswalk \
/path/to/crosswalk-cordova-VERSION-x86 \
/path/to/crosswalk-cordova-VERSION-arm
Then run either:
ionic build android # for ionic
or
cordova build android # for cordova
Thanks to this article for figuring out how to get this to work.
This looks REALLY good!
I do have some concerns though. Removing the Android platform using rm could create some problems. The correct way is to run cordova platform rm android. Extending upon this, I think removing the Android platform in an automated fashion in general could be a scary idea. I think a lot of people add custom code, libraries, files to their Android platform directory instead of using an Apache Cordova Hook. This could potentially wipe out a ton of their hard work.
Any thoughts?