iPhoneProcessor
iPhoneProcessor

Reputation: 5110

Cocos2d-x 4.0 new project not includes xcodeproj file

I used below command to export from command line.

cocos new -l cpp -p com.bfg.mynewpro -d /Volumes/Development/Project/Development/GuruNewPro

Exported source not includes main Xcode project file.

How to get it exported ?

enter image description here

enter image description here

Upvotes: 2

Views: 2340

Answers (2)

Guru
Guru

Reputation: 22042

Steps for First time Cocos2d-x 4.0 setup in Mac OS

  1. Download Cocos2d-X 4.0+ SDK Here : https://www.cocos2d-x.org/download

  2. In Terminal, go inside downloaded cocos2d sdk and execute below command

    ./setup.py
    
  3. To create new project from terminal, execute below command.

    cocos new -l cpp -p com.bfg.newProj -d /Volumes/Development/Project/NewProject
    
  4. Now generate Xcode.proj file, execute below in terminal

    cd MyCppGame //your project root folder
    mkdir ios-build && cd ios-build
    cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos
    open Cocos2d-x.xcodeproj
    

By default cmake not installed in Mac. You can download cmake here https://cmake.org/install/

Install downloaded cmake. Then in terminal execute below command to install command line tool.

 PATH="/Applications/CMake.app/Contents/bin":"$PATH"

 sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

Other Changes:

  1. In Build Settings, Skip install is NO for the main project target

  2. Installation Directory under Deployment must be /Applications

Upvotes: 0

Darren
Darren

Reputation: 162

You have to generate the platform specific project files with cmake.

check out the instructions here https://github.com/cocos2d/cocos2d-x/tree/v4/cmake#generate-ios-project

NOTE:

cd cocos2d-x

This is actually referring to your game directory. Which in your case i suppose is MyCppGame folder.

Upvotes: 2

Related Questions