Meteor’s Android Support
To run ‘meteor add-platform android’ in the project direcotry will add android support to the project. It requires to install android support of meteor at the first time of use. The field will be installed into ~/.meteor/android-bundle. Then we may use ‘meteor run android’ or ‘meteor run android-device’ to launch app in android emulator or device. If the server side is deployed to some server, append –mobile-server https://hostname:port to use it instead of running local server.
By default, meteor installs a copy of android sdks in ~/.meteor/android-bundle /android-sdk, it takes about 1.8GB disk. It is a good idea to have a self-contained clean environment. But if you have installed android sdks and are using a laptop with not-replacible SSD like me, USE_GLOBAL_ADK is the life saver. (Indeed there is a redundant copy of ant, too. But ant is small in size, I just let it go.)
I have met following issues:
meteor –verbose run android
Found com.intel.kext.intelhaxm: undefined
need re-install the haxm in android-sdk extras.
Valid ABIs: default/armeabi-v7a
Error: Invalid –abi x86 for the selected target.
meteor creates its ad with –target 1, 1 is target id, not api level. In the Android SDK installed by meteor, there is only one target with x86 image. But when setting USE_GLOBAL_ADK=t to reuse the system android sdks, most likely the first target doesn’t support x86. Then we have the problem.
It is easy to handle, let’s run：
android-sdk/tools/android list target
to find a target with x86 abi image. In my environment, target 25 is the answer. Then:
android-sdk/tools/android create avd –target 25 –name meteor –abi default/x86 –path /Users/pinxue/.android/avd/meteor.avd
Now, meteor install-sdk android will work.
meteor –verbose run android-device
run failed silently, –verbose shows:
ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: pkg: /data/local/tmp/CordovaApp-debug.apk
It is because the device is running out of storage space, delete some file and run the command again.