Dopo 27 anni, anch'io mi sento a disagio nello sviluppo in un IDE. Ho provato questi suggerimenti (sopra) - e probabilmente non ho seguito tutto bene - quindi ho fatto una ricerca sul web e ho trovato ciò che ha funzionato per me su ' http://incise.org/android-development-on-the- command-line.html '.
La risposta sembrava essere una combinazione di tutte le risposte sopra (per favore dimmi se sbaglio e accetta le mie scuse se è così).
Come accennato in precedenza, eclipse / adt non crea i file ant necessari. Per compilare senza eclipse IDE (e senza creare script ant):
1) Genera build.xml nella directory di primo livello:
android list targets (to get target id used below)
android update project --target target_id --name project_name --path top_level_directory
** my sample project had a target_id of 1 and a project name of 't1', and
I am building from the top level directory of project
my command line looks like android update project --target 1 --name t1 --path `pwd`
2) Successivamente compilo il progetto. Ero un po 'confuso dalla richiesta di non usare "formica". Si spera: requester significava che non voleva scrivere alcun copione per formiche. Dico questo perché il passo successivo è compilare l'applicazione usando ant
ant target
this confused me a little bit, because i thought they were talking about the
android device, but they're not. It's the mode (debug/release)
my command line looks like ant debug
3) Per installare l'apk sul dispositivo ho dovuto usare nuovamente ant:
ant target install
** my command line looked like ant debug install
4) Per eseguire il progetto sul mio telefono Android utilizzo adb.
adb shell 'am start -n your.project.name/.activity'
** Again there was some confusion as to what exactly I had to use for project
My command line looked like adb shell 'am start -n com.example.t1/.MainActivity'
I also found that if you type 'adb shell' you get put to a cli shell interface
where you can do just about anything from there.
3A) Una nota a margine: per visualizzare il registro dall'uso del dispositivo:
adb logcat
3B) Una seconda nota a margine: il collegamento sopra menzionato include anche le istruzioni per costruire l'intero progetto dal comando.
Si spera che questo aiuti con la domanda. So di essere stato davvero felice di trovare qualcosa su questo argomento qui.