http://ufrsciencestech.u-bourgogne.fr/lpsil/_OptionM/C3_Cordova_Phone_Gap_1.pdf

Etape 1 : Installer NodeJs

Téléchargez et installez java jdk1.8 sur http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.htm

Ajoutez la variable d'environnement JAVA_HOME ! Click droit sur poste de travail -> propriétés -> paramètre avancés -> variable d'environement -> ajouter Ajoutez JAVA_HOME avec le chemin vers le répetoire du jdk 1.8

Téléchargez et installez nodejs sur http://nodejs.org.

Une fois l'installation terminée de nodejs, lancez dans la fenêtre windows node.js command prompt.

Tapez la commande ci-dessous dans la fenêtre de commande :

npm -v

et normalement le numéro de version de npm doit s'afficher :image_1[17]_1.png

Etape 2 : Installez ANT

Télécharger la version Zip de ANT sur  http://apache.crihan.fr/dist/ant/binaries/

Dézipper et mettre dans  le répertoire android

set ANT_HOME=C:\Android\apache-ant-1.9.7
set PATH=%PATH%;%ANT_HOME%\bin

Tester si bien installé
ant -version


source : https://evothings.com/doc/build/cordova-install-windows.html

 

Etape 3 : Installez android studio et android sdk

Téléchargez et installez Android sur https://developer.android.com/studio/index.html

Attention repérez où est installé le android sdk.

Ajoutez les variables d'environnement android en ligne de commande :

set ANDROID_HOME=C:\\android-sdk-windows

set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

 

 

Etape 3 : Installer cordova (phonegap)

One of the confusing things is that there are both 'Phonega' and 'Cordova', and the documentation does not make this very clear.  You can install either one and they are almost interchangable, but not 100%.  I would recomment installing Cordava as that is what most of the documention uses (although ironically not the installation docs)

To install cordova run the following command:

 

npm install -g cordova

 

si erreur de proxy

npm config delete proxy
npm config delete https-proxy

I had to run the command multiple times before it would succeed, but that might have just been a connection issue.

 You also have to install plugman

 

npm install -g plugman

 

3: Create test project

Now that you have codova installed it is time to create a test project:

 

cordova create hello com.example.hello HelloWorld

 

Go to the project directory 

 

cd hello

 

and then add the android platform:

set ANDROID_HOME=C:\\android-sdk-windows

set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools


Allez dans le répertoire du projet hello

cd hello

ajoutez la bibliothèque android
cordova platform add android

 

 

It might take a while the first time, if all goes well your project should be read to build:

 

Erreur licence android

mkdir "%ANDROID_HOME%\licenses"

echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"

image_1[18]_1.png

 

Débugger android avec chrome

dans la bare de navigation mettre
chrome://inspect

   

 Etape  4 : pour application windows

Installer visual studio community

https://www.visualstudio.com/fr/vs/cordova/

 

ajouter sdk windows 8 et 10

https://developer.microsoft.com/en-us/windows/downloads

 

Mode développeur :

Pour afficher l'Options pour les développeurs, ouvrez le menu de réglage des paramètres et descendez tout en bas pour activer Options du téléphone. Là, repérez la ligne Numéro de build et appuyez plusieurs fois dessus rapidement. Un petit message vous signale que Vous êtes désormais un développeur.

 

Debugger cordova

chrome://inspect/#devices

 

 

En poursuivant votre navigation sur mon site, vous acceptez l’utilisation des Cookies et autres traceurs  pour réaliser des statistiques de visites et enregistrer sur votre machine vos activités pédagogiques. En savoir plus.