Apache Cordova 3.5(PhoneGap)for Android 第一次測試



1、建立一個專門放專案的資料夾
   c:\ mkdidr test_hello

2、新建一個Android的虛擬機
   C:\ cd [SDK安裝目錄]\sdk
   C:\[SDK安裝目錄]\sdk> android.bat avd

3、建立新專案test02
   c:\> cd test_hello
   c:\test_hello> cordova create test02

   Creating a new cordova project with name "HelloCordova" and id "io.cordova.hello
   cordova" at location "c:\test_hello\test02"
   ...略
   Project successfully created.


4、建立支援 Android 的函式庫(也可以建立firefox OS、iOS等)
   c:\test_hello\test02\www>cordova platforms add android

5、進入www的資料夾,預設裡面有一個index.html,可以拿來直接測試,也可以修改它
   c:\cd www
   c:\test_hello\test02\www> dir/w
       
   [css]        [img]        index.html   [js]
 
6、編譯專案test02
   c:\test_hello\test02> cordova build android
   Running command: c:\test_hello\test02\platforms\android\cordova\build.bat
   ...略

7、開啟android模擬器及上傳編譯後的APP執行檔
   c:\test_hello\test02>cordova emulate android
   Running command: c:\test_hello\test02\platforms\android\cordova\run.bat --emulat
   ...略
 
8、成功會出現下列的APP執行畫面

Windows 11安裝時跳過網路連線