问题
I'm running Linux Mint 17 (based on Ubuntu 14.04) I tried to run my meteor app both on emulator and device.
Please note I had to use sudo to prevent the following error:
Error while running for mobile platforms: EACCES, unlink '/home/manuel/__DEV/PROJECTS/__test/simple-todos/.meteor/local/cordova-build/resources/android_hdpi.icon.png'
On emulator:
sudo meteor run android
Starting android emulator
[[[[[ ~/__DEV/_PROJECTS_/__test/simple-todos ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started app on Android Emulator.
=> Started your app.
=> App running at: http://localhost:3000/
The emulator is shown and loaded. However no app is loaded and I can't find it in application drawer either. Also if I try to open the browser (in the emulator) and go to http://localhost:3000/, it tells me it doesn't exist (while on PC it works at the same time). The PC and the Android device are on the same wifi network.
On device:
sudo meteor run android-device
WARNING: You are testing your app on a remote device.For the mobile app to be
able to connect to the local server, make sure your device is on the
same network, and that the network configuration allows clients to
talk to each other (no client isolation).
[[[[[ ~/__DEV/_PROJECTS_/__test/simple-todos ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started app on Android Device.
I20150804-19:27:46.494(2)? - waiting for device -
=> Started your app.
=> App running at: http://localhost:3000/
In this case after -waiting for device-, it skips straights to app running on http://localhost:3000/. In fact on PC it works. I tried to install adb and run adb devices (even with sudo) and no way I can manage to list the android devices there, not even by using adb over wifi (and connecting via adb connect which on Windows always worked seamlessly.
Any clue on how I can troubleshoot this?
回答1:
I've found several potential issues to solve.
Make sure in addition to Meteor and Cordova you have Apache Ant and Gradle installed.
If not running SUDO, make sure all files in .meteor are set to your ownership
Load the AVD device from the Android SDK (
android avd
), select device, click start, and make sure you select delete all user data optionif meteor run android still fails to load the app, in terminal go to the
.meteor/local/cordova-build/platforms/android/cordova
and type./build
You can watch the build process for errors and make sure the .apk is createdAssuming the build works ok, type
./run
and it should now load up fine into the emulator. If not, look back through the run output and see where things are breaking down.It should then work when you type
meteor run android
. If that fails to update the app, perform step 3 again (clear the AVD user data)
None of this had anything to do with Meteor as far as I could tell. I have testing this on a virtualbox and it worked fine despite comments saying it wouldn't work.
来源:https://stackoverflow.com/questions/31815688/meteorjs-cant-manage-to-deploy-meteor-app-on-android-emulator-device