mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2175 from ricardoquesada/eclipse_readme_fixes
README.md eclipse improvements
This commit is contained in:
commit
1382f7efc0
|
@ -16,66 +16,69 @@ There are two ways of building Android projects.
|
||||||
#### Features:
|
#### Features:
|
||||||
|
|
||||||
1. Complete workflow from Eclipse, including:
|
1. Complete workflow from Eclipse, including:
|
||||||
a. Build C++.
|
* Build C++.
|
||||||
b. Clean C++.
|
* Clean C++.
|
||||||
c. Build and Run whole project.
|
* Build and Run whole project.
|
||||||
d. Logcat view.
|
* Logcat view.
|
||||||
e. Debug Java code.
|
* Debug Java code.
|
||||||
f. Javascript editor.
|
* Javascript editor.
|
||||||
g. Project management.
|
* Project management.
|
||||||
2. True C++ editing, including:
|
2. True C++ editing, including:
|
||||||
a. Code completion.
|
* Code completion.
|
||||||
b. Jump to definition.
|
* Jump to definition.
|
||||||
c. Refactoring tools etc.
|
* Refactoring tools etc.
|
||||||
d. Quick open C++ files.
|
* Quick open C++ files.
|
||||||
|
|
||||||
|
|
||||||
#### Setup Eclipse Environment
|
#### Setup Eclipse Environment (only once)
|
||||||
|
|
||||||
|
|
||||||
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
||||||
|
|
||||||
1. Download Eclipse ADT bundle from [Google](http://developer.android.com/sdk/index.html)
|
1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html)
|
||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
Install Eclipse with Java. Add ADT and CDT plugins.
|
Install Eclipse with Java. Add ADT and CDT plugins.
|
||||||
|
|
||||||
2. Set up Variables:
|
2. Set up Variables:
|
||||||
1. Path Variable **COCOS2DX**:
|
1. Path Variable `COCOS2DX`:
|
||||||
A. Eclipse->Preferences->General->Workspace->**Linked Resources**
|
* Eclipse->Preferences->General->Workspace->**Linked Resources**
|
||||||
B. Click **New** button to add a Path Variable **COCOS2DX** pointing to the root cocos2d-x directory (Directory containing cocos2dx/ external/ tools/ scripting/ etc.).
|
* Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory.
|
||||||
|
![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png)
|
||||||
2. C/C++ Environment Variable **NDK_ROOT**:
|
|
||||||
A. Eclipse->Preferences->General->C/C++->Build->**Environment**.
|
2. C/C++ Environment Variable `NDK_ROOT`:
|
||||||
B. Click **Add** button and add a new variable **NDK_ROOT** pointing to the root NDK directory.
|
* Eclipse->Preferences->C/C++->Build->**Environment**.
|
||||||
|
* Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory.
|
||||||
|
![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png)
|
||||||
|
|
||||||
3. Import libcocos2dx library project:
|
3. Import libcocos2dx library project:
|
||||||
1. File->new->Project..->Android Project From Existing Code.
|
1. File->New->Project->Android Project From Existing Code.
|
||||||
2. Click **Browse** button and open cocos2d-x/cocos2dx/platform/android/java directory.
|
2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory.
|
||||||
3. Click **Finish** to add project.
|
3. Click **Finish** to add project.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Adding and running from Eclipse
|
#### Adding and running from Eclipse
|
||||||
|
|
||||||
|
![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png)
|
||||||
|
|
||||||
1. File->new->Project..->Android Project From Existing Code
|
1. File->New->Project->Android Project From Existing Code
|
||||||
2. **Browse** to cocos2d-x/cocos2dx/samples/Cpp/AssetsManagerTest/proj.android/ directory.
|
2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/`
|
||||||
3. Add the project
|
3. Add the project
|
||||||
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
||||||
|
|
||||||
|
|
||||||
### Running project from Command Line
|
### Running project from Command Line
|
||||||
|
|
||||||
1. `cd cocos2d-x/samples/Cpp/AssetsManagerTest/proj.android/`
|
$ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/
|
||||||
2. `export NDK_ROOT=/path/to/ndk`
|
$ export NDK_ROOT=/path/to/ndk
|
||||||
3. `./build_native.sh`
|
$ ./build_native.sh
|
||||||
4. `ant debug install`
|
$ ant debug install
|
||||||
5. If step 4 results in sdk.dir missing error then follow step 6-8.
|
|
||||||
6. `android list target`
|
If the last command results in sdk.dir missing error then do:
|
||||||
7. `android update project -p . -t (id from step 6)`
|
|
||||||
8. `android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)`
|
$ android list target
|
||||||
|
$ android update project -p . -t (id from step 6)
|
||||||
|
$ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,66 +16,69 @@ There are two ways of building Android projects.
|
||||||
#### Features:
|
#### Features:
|
||||||
|
|
||||||
1. Complete workflow from Eclipse, including:
|
1. Complete workflow from Eclipse, including:
|
||||||
a. Build C++.
|
* Build C++.
|
||||||
b. Clean C++.
|
* Clean C++.
|
||||||
c. Build and Run whole project.
|
* Build and Run whole project.
|
||||||
d. Logcat view.
|
* Logcat view.
|
||||||
e. Debug Java code.
|
* Debug Java code.
|
||||||
f. Javascript editor.
|
* Javascript editor.
|
||||||
g. Project management.
|
* Project management.
|
||||||
2. True C++ editing, including:
|
2. True C++ editing, including:
|
||||||
a. Code completion.
|
* Code completion.
|
||||||
b. Jump to definition.
|
* Jump to definition.
|
||||||
c. Refactoring tools etc.
|
* Refactoring tools etc.
|
||||||
d. Quick open C++ files.
|
* Quick open C++ files.
|
||||||
|
|
||||||
|
|
||||||
#### Setup Eclipse Environment
|
#### Setup Eclipse Environment (only once)
|
||||||
|
|
||||||
|
|
||||||
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
||||||
|
|
||||||
1. Download Eclipse ADT bundle from [Google](http://developer.android.com/sdk/index.html)
|
1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html)
|
||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
Install Eclipse with Java. Add ADT and CDT plugins.
|
Install Eclipse with Java. Add ADT and CDT plugins.
|
||||||
|
|
||||||
2. Set up Variables:
|
2. Set up Variables:
|
||||||
1. Path Variable **COCOS2DX**:
|
1. Path Variable `COCOS2DX`:
|
||||||
A. Eclipse->Preferences->General->Workspace->**Linked Resources**
|
* Eclipse->Preferences->General->Workspace->**Linked Resources**
|
||||||
B. Click **New** button to add a Path Variable **COCOS2DX** pointing to the root cocos2d-x directory (Directory containing cocos2dx/ external/ tools/ scripting/ etc.).
|
* Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory.
|
||||||
|
![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png)
|
||||||
2. C/C++ Environment Variable **NDK_ROOT**:
|
|
||||||
A. Eclipse->Preferences->General->C/C++->Build->**Environment**.
|
2. C/C++ Environment Variable `NDK_ROOT`:
|
||||||
B. Click **Add** button and add a new variable **NDK_ROOT** pointing to the root NDK directory.
|
* Eclipse->Preferences->C/C++->Build->**Environment**.
|
||||||
|
* Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory.
|
||||||
|
![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png)
|
||||||
|
|
||||||
3. Import libcocos2dx library project:
|
3. Import libcocos2dx library project:
|
||||||
1. File->new->Project..->Android Project From Existing Code.
|
1. File->New->Project->Android Project From Existing Code.
|
||||||
2. Click **Browse** button and open cocos2d-x/cocos2dx/platform/android/java directory.
|
2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory.
|
||||||
3. Click **Finish** to add project.
|
3. Click **Finish** to add project.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Adding and running from Eclipse
|
#### Adding and running from Eclipse
|
||||||
|
|
||||||
|
![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png)
|
||||||
|
|
||||||
1. File->new->Project..->Android Project From Existing Code
|
1. File->New->Project->Android Project From Existing Code
|
||||||
2. **Browse** to cocos2d-x/cocos2dx/samples/Cpp/HelloCpp/proj.android/ directory.
|
2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/`
|
||||||
3. Add the project
|
3. Add the project
|
||||||
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
||||||
|
|
||||||
|
|
||||||
### Running project from Command Line
|
### Running project from Command Line
|
||||||
|
|
||||||
1. `cd cocos2d-x/samples/Cpp/HelloCpp/proj.android/`
|
$ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/
|
||||||
2. `export NDK_ROOT=/path/to/ndk`
|
$ export NDK_ROOT=/path/to/ndk
|
||||||
3. `./build_native.sh`
|
$ ./build_native.sh
|
||||||
4. `ant debug install`
|
$ ant debug install
|
||||||
5. If step 4 results in sdk.dir missing error then follow step 6-8.
|
|
||||||
6. `android list target`
|
If the last command results in sdk.dir missing error then do:
|
||||||
7. `android update project -p . -t (id from step 6)`
|
|
||||||
8. `android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)`
|
$ android list target
|
||||||
|
$ android update project -p . -t (id from step 6)
|
||||||
|
$ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,66 +16,69 @@ There are two ways of building Android projects.
|
||||||
#### Features:
|
#### Features:
|
||||||
|
|
||||||
1. Complete workflow from Eclipse, including:
|
1. Complete workflow from Eclipse, including:
|
||||||
a. Build C++.
|
* Build C++.
|
||||||
b. Clean C++.
|
* Clean C++.
|
||||||
c. Build and Run whole project.
|
* Build and Run whole project.
|
||||||
d. Logcat view.
|
* Logcat view.
|
||||||
e. Debug Java code.
|
* Debug Java code.
|
||||||
f. Javascript editor.
|
* Javascript editor.
|
||||||
g. Project management.
|
* Project management.
|
||||||
2. True C++ editing, including:
|
2. True C++ editing, including:
|
||||||
a. Code completion.
|
* Code completion.
|
||||||
b. Jump to definition.
|
* Jump to definition.
|
||||||
c. Refactoring tools etc.
|
* Refactoring tools etc.
|
||||||
d. Quick open C++ files.
|
* Quick open C++ files.
|
||||||
|
|
||||||
|
|
||||||
#### Setup Eclipse Environment
|
#### Setup Eclipse Environment (only once)
|
||||||
|
|
||||||
|
|
||||||
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
||||||
|
|
||||||
1. Download Eclipse ADT bundle from [Google](http://developer.android.com/sdk/index.html)
|
1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html)
|
||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
Install Eclipse with Java. Add ADT and CDT plugins.
|
Install Eclipse with Java. Add ADT and CDT plugins.
|
||||||
|
|
||||||
2. Set up Variables:
|
2. Set up Variables:
|
||||||
1. Path Variable **COCOS2DX**:
|
1. Path Variable `COCOS2DX`:
|
||||||
A. Eclipse->Preferences->General->Workspace->**Linked Resources**
|
* Eclipse->Preferences->General->Workspace->**Linked Resources**
|
||||||
B. Click **New** button to add a Path Variable **COCOS2DX** pointing to the root cocos2d-x directory (Directory containing cocos2dx/ external/ tools/ scripting/ etc.).
|
* Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory.
|
||||||
|
![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png)
|
||||||
2. C/C++ Environment Variable **NDK_ROOT**:
|
|
||||||
A. Eclipse->Preferences->General->C/C++->Build->**Environment**.
|
2. C/C++ Environment Variable `NDK_ROOT`:
|
||||||
B. Click **Add** button and add a new variable **NDK_ROOT** pointing to the root NDK directory.
|
* Eclipse->Preferences->C/C++->Build->**Environment**.
|
||||||
|
* Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory.
|
||||||
|
![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png)
|
||||||
|
|
||||||
3. Import libcocos2dx library project:
|
3. Import libcocos2dx library project:
|
||||||
1. File->new->Project..->Android Project From Existing Code.
|
1. File->New->Project->Android Project From Existing Code.
|
||||||
2. Click **Browse** button and open cocos2d-x/cocos2dx/platform/android/java directory.
|
2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory.
|
||||||
3. Click **Finish** to add project.
|
3. Click **Finish** to add project.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Adding and running from Eclipse
|
#### Adding and running from Eclipse
|
||||||
|
|
||||||
|
![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png)
|
||||||
|
|
||||||
1. File->new->Project..->Android Project From Existing Code
|
1. File->New->Project->Android Project From Existing Code
|
||||||
2. **Browse** to cocos2d-x/cocos2dx/samples/Cpp/SimpleGame/proj.android/ directory.
|
2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/`
|
||||||
3. Add the project
|
3. Add the project
|
||||||
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
||||||
|
|
||||||
|
|
||||||
### Running project from Command Line
|
### Running project from Command Line
|
||||||
|
|
||||||
1. `cd cocos2d-x/samples/Cpp/SimpleGame/proj.android/`
|
$ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/
|
||||||
2. `export NDK_ROOT=/path/to/ndk`
|
$ export NDK_ROOT=/path/to/ndk
|
||||||
3. `./build_native.sh`
|
$ ./build_native.sh
|
||||||
4. `ant debug install`
|
$ ant debug install
|
||||||
5. If step 4 results in sdk.dir missing error then follow step 6-8.
|
|
||||||
6. `android list target`
|
If the last command results in sdk.dir missing error then do:
|
||||||
7. `android update project -p . -t (id from step 6)`
|
|
||||||
8. `android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)`
|
$ android list target
|
||||||
|
$ android update project -p . -t (id from step 6)
|
||||||
|
$ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,66 +16,69 @@ There are two ways of building Android projects.
|
||||||
#### Features:
|
#### Features:
|
||||||
|
|
||||||
1. Complete workflow from Eclipse, including:
|
1. Complete workflow from Eclipse, including:
|
||||||
a. Build C++.
|
* Build C++.
|
||||||
b. Clean C++.
|
* Clean C++.
|
||||||
c. Build and Run whole project.
|
* Build and Run whole project.
|
||||||
d. Logcat view.
|
* Logcat view.
|
||||||
e. Debug Java code.
|
* Debug Java code.
|
||||||
f. Javascript editor.
|
* Javascript editor.
|
||||||
g. Project management.
|
* Project management.
|
||||||
2. True C++ editing, including:
|
2. True C++ editing, including:
|
||||||
a. Code completion.
|
* Code completion.
|
||||||
b. Jump to definition.
|
* Jump to definition.
|
||||||
c. Refactoring tools etc.
|
* Refactoring tools etc.
|
||||||
d. Quick open C++ files.
|
* Quick open C++ files.
|
||||||
|
|
||||||
|
|
||||||
#### Setup Eclipse Environment
|
#### Setup Eclipse Environment (only once)
|
||||||
|
|
||||||
|
|
||||||
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.
|
||||||
|
|
||||||
1. Download Eclipse ADT bundle from [Google](http://developer.android.com/sdk/index.html)
|
1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html)
|
||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
Install Eclipse with Java. Add ADT and CDT plugins.
|
Install Eclipse with Java. Add ADT and CDT plugins.
|
||||||
|
|
||||||
2. Set up Variables:
|
2. Set up Variables:
|
||||||
1. Path Variable **COCOS2DX**:
|
1. Path Variable `COCOS2DX`:
|
||||||
A. Eclipse->Preferences->General->Workspace->**Linked Resources**
|
* Eclipse->Preferences->General->Workspace->**Linked Resources**
|
||||||
B. Click **New** button to add a Path Variable **COCOS2DX** pointing to the root cocos2d-x directory (Directory containing cocos2dx/ external/ tools/ scripting/ etc.).
|
* Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory.
|
||||||
|
![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png)
|
||||||
2. C/C++ Environment Variable **NDK_ROOT**:
|
|
||||||
A. Eclipse->Preferences->General->C/C++->Build->**Environment**.
|
2. C/C++ Environment Variable `NDK_ROOT`:
|
||||||
B. Click **Add** button and add a new variable **NDK_ROOT** pointing to the root NDK directory.
|
* Eclipse->Preferences->C/C++->Build->**Environment**.
|
||||||
|
* Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory.
|
||||||
|
![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png)
|
||||||
|
|
||||||
3. Import libcocos2dx library project:
|
3. Import libcocos2dx library project:
|
||||||
1. File->new->Project..->Android Project From Existing Code.
|
1. File->New->Project->Android Project From Existing Code.
|
||||||
2. Click **Browse** button and open cocos2d-x/cocos2dx/platform/android/java directory.
|
2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory.
|
||||||
3. Click **Finish** to add project.
|
3. Click **Finish** to add project.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Adding and running from Eclipse
|
#### Adding and running from Eclipse
|
||||||
|
|
||||||
|
![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png)
|
||||||
|
|
||||||
1. File->new->Project..->Android Project From Existing Code
|
1. File->New->Project->Android Project From Existing Code
|
||||||
2. **Browse** to cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/ directory.
|
2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/`
|
||||||
3. Add the project
|
3. Add the project
|
||||||
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.
|
||||||
|
|
||||||
|
|
||||||
### Running project from Command Line
|
### Running project from Command Line
|
||||||
|
|
||||||
1. `cd cocos2d-x/samples/Cpp/TestCpp/proj.android/`
|
$ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/
|
||||||
2. `export NDK_ROOT=/path/to/ndk`
|
$ export NDK_ROOT=/path/to/ndk
|
||||||
3. `./build_native.sh`
|
$ ./build_native.sh
|
||||||
4. `ant debug install`
|
$ ant debug install
|
||||||
5. If step 4 results in sdk.dir missing error then follow step 6-8.
|
|
||||||
6. `android list target`
|
If the last command results in sdk.dir missing error then do:
|
||||||
7. `android update project -p . -t (id from step 6)`
|
|
||||||
8. `android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)`
|
$ android list target
|
||||||
|
$ android update project -p . -t (id from step 6)
|
||||||
|
$ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue