forked from zilongshanren/programmers-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67de5eb
commit b8bfeca
Showing
9 changed files
with
203 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,25 @@ | ||
# Appendix A: Android (Terminal) Installation and Setup | ||
|
||
## Environment Requirements | ||
* A Supported OS (Ubuntu 12.10+, OS X 10.7+, Windows 7+) | ||
* Cocos2d-x v3.0 ([HERE](https://github.com/cocos2d/cocos2d-x/ "cocos2d-x")) | ||
* JDK/SDK 1.6+ | ||
* NDK r9d+ | ||
* Apache Ant | ||
* Python 2.7.5 | ||
|
||
## Prerequisite | ||
* Download [cocos2d-x](http://cocos2d-x.org/download) and unzip it. (maybe: ~/) | ||
|
||
* Download JDK, SDK and NDK ([JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [SDK](http://developer.android.com/sdk/index.html), [NDK](https://developer.android.com/tools/sdk/ndk/index.html)) | ||
|
||
* After downloading it, unzip the SDK and NDK to the same root location. (maybe: ~/AndroidDev) | ||
|
||
* Verify that `Python 2.7` is installed and is accessible | ||
|
||
* Install and verify `Apache Ant` ([Apache.org](http://ant.apache.org/bindownload.cgi)) | ||
|
||
* Run `setup.py` to configure your Android development environment. This will set the necessary environment variables needed. If you haven't configured this environment before, you will be prompted to enter paths for variables that are not found. | ||
# Appendix A: Prerequisites | ||
|
||
** Caution: You must *not* use the `~` sign. Use the full path to your *home* directory. Otherwise, the scripts will fail due to error path value. | ||
**Build Requirements** | ||
|
||
** `*COCOS2D_CONSOLE_ROOT*` environment variable to point to the *bin* directory under *~/cocos2d-x/tools/cocos2d-console* directory. | ||
* Mac OS X 10.7+, Xcode 4.6+ | ||
|
||
** `*NDK_ROOT*` environment variable to point to the location of where you put the NDK. (i.e android-ndk-r9d/) | ||
* Windows 7+, VS 2012+ | ||
|
||
** `*ANDROID_SDK_ROOT*` environment variable to point to the location of where you put the `adt-bundle`. Example `/Users/guanghui/AndroidDev/adt-bundle-mac-x86_64-20130522/sdk/`. The adt-bundle-mac-x86_64-xxxx, the xxxx number maybe different. So please note this non-trival difference. | ||
* Ubuntu 12.10+, CMake 2.6+ | ||
|
||
** `*ANT_ROOT*` environment variable to point to the location of where you put `apache-ant-x.x.x`. The `apache-ant-x.x.x`, the x.x.x number maybe different. | ||
|
||
* In your `cocos2d-x` directory run` python setup.py` | ||
|
||
* On *nix systems, now issue the following commands: | ||
|
||
source ~/.bash_profile | ||
|
||
* On win32 systems, close the command line windows and restart it. | ||
|
||
## Use `android-build.py` to build cocos2d-x samples | ||
|
||
* Change your directory to the where the `android-build.py` script is located. (usually `cocos2d-x/build`) | ||
* Python 2.7.5 | ||
|
||
* execute: | ||
python android-build.py -p 19 cpp-tests | ||
* NDK, JDK, ANT (Android development) | ||
|
||
## How to deploy it on your Android phone via command line | ||
**Runtime Requirements** | ||
|
||
* Enable *[USB Debugging](http://stackoverflow.com/questions/16707137/how-to-find-and-turn-on-usb-debugging-mode-on-nexus-4)* on your phone and then connect your phone via USB. | ||
* iOS 5.0+ for iPhone / iPad games | ||
|
||
* Change your directory to the the *bin* directory of your android project | ||
* Android 2.3+ for Android games | ||
|
||
* Use **adb** to install the apk to your android phone: | ||
adb install TestsDemo-debug.apk | ||
* Windows Phone 8+ for Windows Phone games | ||
|
||
* OS X v10.6+ for Mac games | ||
|
||
* Windows 7+ for Win games |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,58 @@ | ||
# Appendix B: Android (Eclipse) Installation and Setup | ||
# Appendix B: Android (Terminal) Installation and Setup | ||
|
||
## Prerequisite | ||
* Complete steps in Appendix A | ||
## Environment Requirements | ||
* A Supported OS (Ubuntu 12.10+, OS X 10.7+, Windows 7+) | ||
* Cocos2d-x v3.0 ([HERE](https://github.com/cocos2d/cocos2d-x/ "cocos2d-x")) | ||
* JDK/SDK 1.6+ | ||
* NDK r9d+ | ||
* Apache Ant | ||
* Python 2.7.5 | ||
|
||
## Open the proj.android project with Eclipse. | ||
## Prerequisite | ||
* Download [cocos2d-x](http://cocos2d-x.org/download) and unzip it. (maybe: ~/) | ||
|
||
* Launch Eclipse | ||
* Download JDK, SDK and NDK ([JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [SDK](http://developer.android.com/sdk/index.html), [NDK](https://developer.android.com/tools/sdk/ndk/index.html)) | ||
|
||
* Right click your mouse at the empty area of the `Package Explorer` and choose `Import...`. | ||
* After downloading it, unzip the SDK and NDK to the same root location. (maybe: ~/AndroidDev) | ||
|
||
* Choose `Existing Android Code Into Workspace` from the pop up dialog and Click `Next`. | ||
* Verify that `Python 2.7` is installed and is accessible | ||
|
||
* Click the `Browse...` button to choose the directory of Cpp-Tests' `proj.android`. and Click Ok. | ||
* Install and verify `Apache Ant` ([Apache.org](http://ant.apache.org/bindownload.cgi)) | ||
|
||
* Click Finish. | ||
* Run `setup.py` to configure your Android development environment. This will set the necessary environment variables needed. If you haven't configured this environment before, you will be prompted to enter paths for variables that are not found. | ||
|
||
## Import Libcocos2dx Project | ||
* Same steps as above only using the path of the libcocos2dx project is `[your own game project folder]/cocos/2d/platform/android/java`. | ||
** Caution: You must *not* use the `~` sign. Use the full path to your *home* directory. Otherwise, the scripts will fail due to error path value. | ||
|
||
## Build and Run the Android Project | ||
* Connect your Android phone with `USB remote debugging` option enabled. | ||
** `*COCOS2D_CONSOLE_ROOT*` environment variable to point to the *bin* directory under *~/cocos2d-x/tools/cocos2d-console* directory. | ||
|
||
** `*NDK_ROOT*` environment variable to point to the location of where you put the NDK. (i.e android-ndk-r9d/) | ||
|
||
** `*ANDROID_SDK_ROOT*` environment variable to point to the location of where you put the `adt-bundle`. Example `/Users/guanghui/AndroidDev/adt-bundle-mac-x86_64-20130522/sdk/`. The adt-bundle-mac-x86_64-xxxx, the xxxx number maybe different. So please note this non-trival difference. | ||
|
||
** `*ANT_ROOT*` environment variable to point to the location of where you put `apache-ant-x.x.x`. The `apache-ant-x.x.x`, the x.x.x number maybe different. | ||
|
||
* In your `cocos2d-x` directory run` python setup.py` | ||
|
||
* On *nix systems, now issue the following commands: | ||
|
||
source ~/.bash_profile | ||
|
||
* On win32 systems, close the command line windows and restart it. | ||
|
||
## Use `android-build.py` to build cocos2d-x samples | ||
|
||
* Change your directory to the where the `android-build.py` script is located. (usually `cocos2d-x/build`) | ||
|
||
* execute: | ||
python android-build.py -p 19 cpp-tests | ||
|
||
## How to deploy it on your Android phone via command line | ||
|
||
* Enable *[USB Debugging](http://stackoverflow.com/questions/16707137/how-to-find-and-turn-on-usb-debugging-mode-on-nexus-4)* on your phone and then connect your phone via USB. | ||
|
||
* Change your directory to the the *bin* directory of your android project | ||
|
||
* Use **adb** to install the apk to your android phone: | ||
adb install TestsDemo-debug.apk | ||
|
||
* Make sure your computer can recognize your phone (you might need to install drivers for your specific phone) | ||
|
||
* Right click on the project and choose `Run as...` -> `Android Application`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
# Appendix C: iOS Installation and Setup | ||
|
||
## Environment Requirements | ||
* Mac OS X 10.8+ | ||
* Cocos2d-x v3.0 ([HERE](http://cocos2d-x.org/download)) | ||
* Xcode 4.6.2+ ([Apple Developer Website](https://developer.apple.com/downloads/index.action)) | ||
* iOS 5.0+ | ||
|
||
## Prerequisite | ||
* Download cocos2d-x and unzip it. (maybe: ~/) | ||
|
||
## Build and Run | ||
* Enter `cocos2d-x/build` and open `cocos2d_tests.xcodeproj` | ||
* Choose `cpp-tests iOS` from targets drop-down box | ||
* Click `run` to compile and run `cpp-tests` | ||
|
||
## Running on an IOS Device | ||
* In order to run on IOS Device an [IOS Developer Program](https://developer.apple.com/programs/ios/) membership is needed. The steps to run on iOS device are the same except you select you device from the device list. | ||
# Appendix C: Android (Eclipse) Installation and Setup | ||
|
||
## Prerequisite | ||
* Complete steps in Appendix A | ||
|
||
## Open the proj.android project with Eclipse. | ||
|
||
* Launch Eclipse | ||
|
||
* Right click your mouse at the empty area of the `Package Explorer` and choose `Import...`. | ||
|
||
* Choose `Existing Android Code Into Workspace` from the pop up dialog and Click `Next`. | ||
|
||
* Click the `Browse...` button to choose the directory of Cpp-Tests' `proj.android`. and Click Ok. | ||
|
||
* Click Finish. | ||
|
||
## Import Libcocos2dx Project | ||
* Same steps as above only using the path of the libcocos2dx project is `[your own game project folder]/cocos/2d/platform/android/java`. | ||
|
||
## Build and Run the Android Project | ||
* Connect your Android phone with `USB remote debugging` option enabled. | ||
|
||
* Make sure your computer can recognize your phone (you might need to install drivers for your specific phone) | ||
|
||
* Right click on the project and choose `Run as...` -> `Android Application`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,15 @@ | ||
# Appendix E: Linux Installation and Setup | ||
# Appendix E: Mac OSX Installation and Setup | ||
|
||
## Environment Requirements | ||
* Ubuntu 12.10+ | ||
## Environment Requirements | ||
* Mac OS X 10.8+ | ||
* Cocos2d-x v3.0 ([HERE](http://cocos2d-x.org/download)) | ||
* CMake 2.6+ | ||
* Xcode 4.6.2+ ([Apple Developer Website](https://developer.apple.com/downloads/index.action)) | ||
* iOS 5.0+ | ||
|
||
## Prerequisite | ||
* Download [cocos2d-x](http://cocos2d-x.org/download) and unzip it. (maybe: ~/) | ||
* Download cocos2d-x and unzip it. (maybe: ~/) | ||
|
||
* Install dependencies. The dependencies are: | ||
|
||
libx11-dev | ||
libxmu-dev | ||
libglu1-mesa-dev | ||
libgl2ps-dev | ||
libxi-dev | ||
g++ | ||
libzip-dev | ||
libpng12-dev | ||
libcurl4-gnutls-dev | ||
libfontconfig1-dev | ||
libsqlite3-dev | ||
libglew*-dev | ||
libssl-dev | ||
|
||
If you are using Ubuntu/Debian, there is a shell script **build/install-deps-linux.sh** for you to install the dependences easily. Run commands below in terminal: | ||
|
||
$ cd $cocos2dx_root/build | ||
$ ./install-deps-linux.sh | ||
|
||
Otherwise, you should install the dependencies manually. | ||
|
||
## Generate Makefile | ||
|
||
Run `cmake` to generate `makefile`: | ||
|
||
$ mkdir linux-build | ||
$ cd linux-build | ||
$ cmake ../.. | ||
|
||
When `cmake` returns correctly, many files & folders will be generated in `coocs2dx_root/build/linux-build` | ||
|
||
## Compile | ||
|
||
Run `make` to compile: | ||
|
||
$ make | ||
|
||
Application will be generated in `cocos2dx_root/build/linux-build/bin/cpp-tests/` if compiled successfully. | ||
|
||
## Run | ||
|
||
$ cd bin/cpp-tests/ | ||
$ ./cpp-tests | ||
## Build and Run | ||
* Enter `cocos2d-x/build` and open `cocos2d_tests.xcodeproj` | ||
* Choose `cpp-tests Mac` from targets drop-down box | ||
* Click `run` to compile and run `cpp-tests` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,55 @@ | ||
# Appendix F: Win32 Installation and Setup | ||
# Appendix F: Linux Installation and Setup | ||
|
||
## Environmental Requirements | ||
* Windows 7+ | ||
## Environment Requirements | ||
* Ubuntu 12.10+ | ||
* Cocos2d-x v3.0 ([HERE](http://cocos2d-x.org/download)) | ||
* Visual Studio 2012+ | ||
* Dependencies: Python 2.7 | ||
* CMake 2.6+ | ||
|
||
## Prerequisite | ||
* Download [cocos2d-x](http://cocos2d-x.org/download) and unzip it. (maybe: ~/) | ||
|
||
## Compile and Run the TestCpp Project | ||
* Open "cocos2d-win32.vc2012.sln" in the "build" folder | ||
* Install dependencies. The dependencies are: | ||
|
||
* Right click the "TestCpp" project, and select "Set as StartUp Project". Compile and run the "TestCpp" project. | ||
libx11-dev | ||
libxmu-dev | ||
libglu1-mesa-dev | ||
libgl2ps-dev | ||
libxi-dev | ||
g++ | ||
libzip-dev | ||
libpng12-dev | ||
libcurl4-gnutls-dev | ||
libfontconfig1-dev | ||
libsqlite3-dev | ||
libglew*-dev | ||
libssl-dev | ||
|
||
If you are using Ubuntu/Debian, there is a shell script **build/install-deps-linux.sh** for you to install the dependences easily. Run commands below in terminal: | ||
|
||
$ cd $cocos2dx_root/build | ||
$ ./install-deps-linux.sh | ||
|
||
Otherwise, you should install the dependencies manually. | ||
|
||
## Generate Makefile | ||
|
||
Run `cmake` to generate `makefile`: | ||
|
||
$ mkdir linux-build | ||
$ cd linux-build | ||
$ cmake ../.. | ||
|
||
When `cmake` returns correctly, many files & folders will be generated in `coocs2dx_root/build/linux-build` | ||
|
||
## Compile | ||
|
||
Run `make` to compile: | ||
|
||
$ make | ||
|
||
Application will be generated in `cocos2dx_root/build/linux-build/bin/cpp-tests/` if compiled successfully. | ||
|
||
## Run | ||
|
||
$ cd bin/cpp-tests/ | ||
$ ./cpp-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
# Appendix G: WP8 Installation and Setup | ||
# Appendix G: Win32 Installation and Setup | ||
|
||
## Environmental Requirements | ||
* Windows 8.0/8.1 | ||
* Windows 7+ | ||
* Cocos2d-x v3.0 ([HERE](http://cocos2d-x.org/download)) | ||
* Visual Studio 2012+ | ||
* Windows Phone SDK 8.0 ([HERE](http://dev.windowsphone.com/en-US/downloadsdk)) | ||
* Dependencies: Python 2.7 | ||
|
||
## Prerequisite | ||
* Download [cocos2d-x](http://cocos2d-x.org/download) and unzip it. (maybe: ~/) | ||
* register to be a Windows Phone Developer ([HERE](http://msdn.microsoft.com/en-us/library/windowsphone/help/jj206719(v=vs.105)) | ||
|
||
## Compile and Run the TestCpp Project | ||
* Open "cocos2d-win32.vc2012.sln" in the "build" folder | ||
* Right click the "cpp-tests" project, and select "Set as StartUp Project". Select "Emulator" or a "Device" to run the project on. If you sect "Device" you need to connect your phone device using usb. Compile and run the TestCpp project. | ||
* Open "cocos2d-win32.vc2012.sln" in the "build" folder | ||
|
||
## How to debug in project | ||
* Right click "cpp-tests", select "Properties", in "Debug", select debug target. | ||
|
||
* If you select "Managed Only" in "UI Task", it's to debug c# code in "cpp-tests". If you select "Native Only", it's to debug c++ code in "cpp-testsComponent". If you select "Native Only" and want to use "CCLog" function, right click "cpp-testsComponent" and define "COCOS2D_DEBUG=1" in "Preprocessor Definitions" | ||
* Right click the "TestCpp" project, and select "Set as StartUp Project". Compile and run the "TestCpp" project. |
Oops, something went wrong.