Developers Manual > Cocos2d-x > Getting Started with Cocos2d-x > How to Run cpp-tests on WP8

How to run cpp-tests on WP8

Environmental Requirements

Enable to start develop on Windows phone

registe to be a windows phone developer

visit the MSDN's windows phone link of developer register http://msdn.microsoft.com/en-us/library/windowsphone/help/jj206719(v=vs.105))

fill with your windows account and regist Windows phone developer account in steps

explanation of the Windows account:your account of Hotmail or SkyDrive or Xbox LIVE

the fee of developer account: $19 per year, while students account is free but cannot release applications with fees.

Compile and Run the TestCpp Project

  • Download cocos2d-x from our download page and unzip it on your working directory. The structure of the directory should look like as following:

  • Open file "cocos2d-wp8.vc2012.sln" in "build" folder as fllowing:

  • Right click the "cpp-tests" project, and select "Set as StartUp Project", you can select "Emulator" or a "Device" to run project, if you use Device, you need to connect your phone device using usb.

then you can compile and run the TestCpp project, here is the screenshot in Emulator:

How to debug in project

right click cpp-tests, select "Properties", in "Debug", you can select debug target:

If you select "Managed Only" in "UI Task", it's to debug c# code in cpp-tests. And if you select "Native Only", it's to debug c++ code in cpp-testsComponent. Note that If you select "Native Only" and want to use CCLog function to write log in Output, right click cpp-testsComponent and define "COCOS2D_DEBUG=1" in "Preprocessor Definitions":

6.png (32.8 kB) owen, 2014-04-02 06:24

7.png (35.3 kB) owen, 2014-04-02 06:24

8.png (42.3 kB) owen, 2014-04-02 06:24

1.png (10.7 kB) owen, 2014-04-02 06:24

2.png (12.3 kB) owen, 2014-04-02 06:24

3.png (11.7 kB) owen, 2014-04-02 06:24

4.png (27.1 kB) owen, 2014-04-02 06:24

5.png (63.3 kB) owen, 2014-04-02 06:24

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.