I'm trying to install my Phonegap application onto an Android AVD/Emulator. I have launched the AVD and it's registering as 5554:Nexus_S.
When using the Phonegap commands at the Windows prompt I am typing:
phonegap build android
phonegap install android
The output I get says it successfully installed the app onto the device, but it never shows up. This is the output of the install command:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] trying to install app onto device
cp: dest file already exists: C:\Users\username\app\platforms\android\assets\www\phonegap.js
[phonegap] successfully installed onto device
I've tried variations of targeting the device using options with no luck:
--device=5554
--target=5554
Any ideas?
I figured it out. You have to specify the --emulator= in the call, so the command looks like:
phonegap install --emulator=emulator-5554 android
You can find the name/id of your running emulators by running the list-started-emulators.bat under the /platforms/android/cordova/lib/ folder in your project.
Another quick note is that sometimes even when you have started the emulator phonegap will not recognize it... so you have to start it from phonegap bat file so that the right process number is registered. to do this.
Use the following command,
1. List-emulator-images.bat : This will display available emulator images you have
2. start-emulator : This will start the emulator which will register with phonegap.
Also make sure you are running all of this from and ADMIN Enabled command prompt.
Okay, I've solved my problem. This solution may not be applied to all, but I was suffering from the same problem as I've mentioned in the comments of the question.
What did I do wrong?
I made some changes in one of the plugins.
I was working on my app and added the Vibration plugin. I made some changes in the plugin, both in the generic version [your_project_root\plugins\org.apache.cordova.vibration\src\android\Vibration.java] and also in the platform specific version [your_project_root\platforms\android\src\org\apache\cordova\vibration\Vibration.java].
But when I reverted the changes back, everything went fine.
I say it again, this solution may not be generic but can be useful for at least my type of problem.
And this gives rise to another question, can't we make changes in the Plugins?I think it is totally fine to make changes in them. Maybe I had done something wrong.
Related
I built an app on Meteor, and deployed it to a Digitalocean server using mupx. On my local machine (where the android SDK is installed), I built the app for android with the following command:
meteor build --server=http://SERVER.IP /output/directory
I then signed the app and put it on my phone, and it runs fine, and is connected to the database. The problem is that, when I change code on the server, it doesn't automatically get pushed to the app. The only way I've been able to update the app is to build a new .apk and put it on my phone.
Some background info:
I don't have the android platform on the server, only on my local machine, and the hot code push works in the browser when I go to the IP.
Well, it seems I answered my own question in the question. You really do need to have android on the server, as well as the SDK. Just look up instruction to install the android sdk on a server (no gui). Now it works.
From 1.3-beta.12, added a --server-only option to meteor build that doesn't require the mobile SDKs to be installed on the build machine, but that will still build web.cordova whenios or android platforms have been added to the project.
Reference: meteor forum
I am trying to use the Android emulator to install an app on it.
Unfortunately the emulator is never starting up. I use the following
command in my cordova project:
cordova emulate android
The last output I get from console is:
Waiting for emulator...
But the emulator does never start (I waited 45 minutes now).
The path variables are all correctly set and I can start the
emulator using Eclipse or Android studio but not using the
command from cordova.
Any hints?
If you can start the emulator through android studio, then as a work around start the emulator outside and run the command
cordova run android
It will deploy your app in the already running emulator.
Check emulator path settings
https://cordova.apache.org/docs/en/4.0.0/guide_platforms_android_index.md.html
If not able to execute then do :
use the alternate shell interface:
$ /path/to/project/cordova/run --emulator
Instead of relying on whichever emulator is currently enabled within the SDK, you can refer to each by the names you supply:
$ /path/to/project/cordova/run --target=NAME
Check the documentation above and see whether your PC supports virtualization or not.
I was getting the same issue, I resolved it by:
Open Android device manager, click on window -> Android Virtual Device Manager
There you will see listing of all the Android Virtual Devices, if you see any device with repairable icon on it, just click on repair and then try. It works.
I had the same problem. Though cordova started the emulator, the command line kept on saying 'Waiting for emulator...' forever.
The trick is, before running the command:
cordova run android
make sure you navigate into the android platform folder. That is, don't run the command from within the
/project folder
but instead from within
/project/platforms/android folder
That will launch your application in the Android emulator
I'm making my first steps in phonegap. I've been able to set up a project, install a plugin and build the app on my phone without errors. However, now, when I try to change the layout of my www/index.html in the project's root platforms/android/assets/www/index.html stays untouched whenever I (re)build the app.
I'm basically working in eclipse, only for html and javascript I use sublime. I've searched now for a couple of hours for a solution. The most promising approach was this thread: Changes to HTML files not showing on built phonegap 3.0 app ... but even that didn't work.
What can I have done wrong? There's no error, no warning (none resulting from the build process) and I don't know how I could debug the issue. I'm currently using phonegap/cordova 4.2.0
Any clue? Thanks
I still don't know the reason for my problem. However, installing the app via cordova CLI rather than eclipse seems to have solved the problem:
$ cordova prepare android
$ cordova run android
I'm using Eclipse to run my android mobile app. The problem is that when modify code the change not appear in the deployed app on device. Remain ever the same app on device.
If you are changing code in yourProject->www folder, then you need to build it first with command prompt /cli
OR you need to directly change the files in yourProject->platforms->...->www before running from Eclipse
I started PhoneGap today only. I have experience with native code but not with HTML5 stuff. I am comfortable with GUI so CLI is new to me.
So I am trying to build app in android. But it uploads data to remote site & as its my second app, Its says "Private app limit reached".
Is there any way to build file locally?? Like with no internet connection. Screenshot attached for further refrence. Thankyou in advance
If you look at the Android platform guide section of the PhoneGap documentation you'll get instructions for setting up your SDK locally.
Pay attention so that you got your PATH setup correctly, a quick way to verify that on windows is to type echo %PATH% in the command prompt. If you already had your command prompt open as you set PATH it'll not be reflected so you've to close cmd and open it again.
After the SDK is setup successfully and you got your PATH verified you should be able to do the following to run it:
phonegap install android
phonegap local build android
phonegap local run android --emulator