在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > Cocos2d-x學(xué)習(xí)之創(chuàng)建Android工程和編譯

            Cocos2d-x學(xué)習(xí)之創(chuàng)建Android工程和編譯

            作者: 時間:2016-10-08 來源:網(wǎng)絡(luò) 收藏

            安裝好,相應(yīng)的環(huán)境之后,我們便可以開始創(chuàng)建cocos2d-x 的android 工程了

            本文引用地址:http://www.biyoush.com/article/201610/305430.htm

            進入cocs2d-x目錄,用文本編輯器打開create-android-project.bat(在windows 7上如果正常雙擊,可能創(chuàng)建時有些文件的權(quán)限不足,導(dǎo)致創(chuàng)建工程不成,可以在此文件的第一行加上cd /d %~dp0,然后右鍵以管理員身份運行)

            找到以下幾個定義:

            復(fù)制代碼

            @echo off

            :: This script is used to create an android project.

            :: You should modify _ANDROIDTOOLS _CYGBIN _NDKROOT to work under your environment.

            :: Don't change it until you know what you do.

            cd /d %~dp0

            setlocal

            :: Check if it was run under cocos2d-x root

            if not exist %create-android-project.bat echo Error!!! You should run it under cocos2dx root pause exit 2

            if not exist %~dpn0.sh echo Script %~dpn0.sh not found pause exit 3

            :: modify it to work under your environment

            set _CYGBIN=D:cygwinbin

            if not exist %_CYGBIN% echo Couldn't find Cygwin at %_CYGBIN% pause exit 4

            :: modify it to work under your environment

            set _ANDROIDTOOLS=E:android-sdk-windowstools

            if not exist %_ANDROIDTOOLS% echo Couldn't find android sdk tools at %_ANDROIDTOOLS% pause exit 5

            :: modify it to work under your environment

            set _NDKROOT=E:android-ndk-r8-windowsandroid-ndk-r8

            if not exist %_NDKROOT% echo Couldn't find ndk at %_NDKROOT% pause exit 6

            :: create android project

            set /P _PACKAGEPATH=Please enter your package path. For example: org.cocos2dx.example:

            set /P _PROJECTNAME=Please enter your project name:

            if exist %%_PROJECTNAME% echo %_PROJECTNAME% exists, please use another name pause exit 7

            echo Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 3.0

            echo Other versions have not tested.

            call %_ANDROIDTOOLS%android.bat list targets

            set /P _TARGETID=Please input target id:

            set _PROJECTDIR=%%_PROJECTNAME%

            echo Create android project

            call %_ANDROIDTOOLS%android.bat create project -n %_PROJECTNAME% -t %_TARGETID% -k %_PACKAGEPATH% -a %_PROJECTNAME% -p %_PROJECTDIR%

            :: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT%

            for /f delims= %%A in ('%_CYGBIN%cygpath.exe %~dpn0.sh') do set _CYGSCRIPT=%%A

            :: Resolve current dir to cygwin path

            for /f delims= %%A in ('%_CYGBIN%cygpath.exe %') do set _CURRENTDIR=%%A

            :: Resolve ndk dir to cygwin path

            for /f delims= %%A in ('%_CYGBIN%cygpath.exe %_NDKROOT%') do set _NDKROOT=%%A

            :: Throw away temporary env vars and invoke script, passing any args that were passed to us

            endlocal %_CYGBIN%bash --login %_CYGSCRIPT% %_CURRENTDIR% %_PROJECTNAME% %_NDKROOT% %_PACKAGEPATH% windows

            pause

            復(fù)制代碼

            將_CYGBIN=設(shè)置為cycgwinbin安裝的的絕對路徑。

            將_ANDROIDTOOLS設(shè)置為android sdk 的tools絕對路徑

            將_NDKROOT設(shè)置為android ndk的絕對路徑

            修改完畢,保存后

            雙擊create-android-project.bat開始工程創(chuàng)建向?qū)?/p>

            首先是輸入包名(建議按照android的命名規(guī)則),如com.android.test

            然后輸入工程名稱(注意不要輸入已有的文件夾的名字,如果同名,會被覆蓋掉的),如testandroid,如下圖:

            wps_clip_image-15949

            然后選擇target id,

            wps_clip_image-14424

            其會列出機器上安裝的所有版本的sdk,我們選擇6,即2.3.2的sdk.

            wps_clip_image-2448

            進入g:cocos2d-x目錄發(fā)現(xiàn)多了一個名為testandroid的目錄,里面包含三個目錄

            wps_clip_image-19661

            其中Classes:是存放默認工程的C++文件

            proj.android 是android的eclipse工程項目

            Resources 資源文件

            下來我們開始編譯剛創(chuàng)建的testandroid項目

            打開cygwin,進入到testandroid/proj.android目錄,輸入 ./build_native.sh 開始編譯如下圖:


            上一頁 1 2 3 下一頁

            關(guān)鍵詞:

            評論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉