{"id":152,"date":"2023-07-14T13:05:00","date_gmt":"2023-07-14T05:05:00","guid":{"rendered":"https:\/\/i.u-ch.com\/?p=152"},"modified":"2023-07-14T16:26:42","modified_gmt":"2023-07-14T08:26:42","slug":"mac%e4%b8%8b%e5%87%86%e5%a4%87cocos2d-x-4-0%e7%9a%84%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/i.u-ch.com\/?p=152","title":{"rendered":"Mac\u4e0b\u51c6\u5907cocos2d-x 4.0\u7684\u5f00\u53d1\u73af\u5883"},"content":{"rendered":"\n<p>1.Python\uff1a<br><code>python --version<\/code><\/p>\n\n\n\n<p>\u9700\u8981Python2\uff0c\u5b98\u65b9\u63a8\u8350\u7684\u662fPython2.7\u3002<\/p>\n\n\n\n<p>\u6ca1\u6709python2\u7684\u53c2\u7167 <a href=\"https:\/\/i.u-ch.com\/?p=132\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/i.u-ch.com\/?p=132<\/a> \u5b89\u88c5\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>2. CMake:<\/p>\n\n\n\n<p><code>cmake --version<\/code><\/p>\n\n\n\n<p>\u6ca1\u6709cmake\u7684\u9700\u8981\u5b89\u88c5<\/p>\n\n\n\n<p><code>brew install cmake<\/code><\/p>\n\n\n\n<p>3.\u4e0b\u8f7d\u5e76\u5b89\u88c5cocos2dx4.0<\/p>\n\n\n\n<p>3.1\uff09\u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1a<a href=\"https:\/\/www.cocos.com\/cocos2dx-download\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.cocos.com\/cocos2dx-download<\/a><\/p>\n\n\n\n<p>3.2\uff09\u79fb\u5230\u81ea\u5df1\u60f3\u8981\u7684\u5de5\u4f5c\u76ee\u5f55\u91cc\u3001\u89e3\u538b\uff08mac\u4e0a\u7684\u526a\u5207\u5feb\u6377\u952e\u7ec4\u5408\uff1aCommand+C\uff0cCommand+Option+V\uff09<\/p>\n\n\n\n<p>3.3\uff09\u4f7f\u7528 cmake \u7f16\u8bd1\u5e76\u8fd0\u884c<br><code>cd COCOS2DX\/tests\/cpp-tests<br>mkdir mac-build<br>cd mac-build<br>cmake ..<br>make<\/code><\/p>\n\n\n\n<p>3.4)\u4ecewin\u628a\u9879\u76ee\u79fb\u690d\u8fc7\u6765:\u4f8b\u5982\u9879\u76ee\u540d\u662fpro001<\/p>\n\n\n\n<p><code>cd pro001 <br>mkdir ios-build &amp;&amp; cd ios-build<br>cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos<\/code><br>\u7136\u540e\u7528xcode\u6253\u5f00pro001\u4e2d\u7684\u9879\u76ee\u6587\u4ef6\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.Python\uff1apython &#8211;version \u9700\u8981Python2\uff0c\u5b98\u65b9\u63a8\u8350\u7684\u662fPython2.7\u3002 \u6ca1\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/i.u-ch.com\/index.php?rest_route=\/wp\/v2\/posts\/152"}],"collection":[{"href":"https:\/\/i.u-ch.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i.u-ch.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i.u-ch.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i.u-ch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=152"}],"version-history":[{"count":9,"href":"https:\/\/i.u-ch.com\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/i.u-ch.com\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/i.u-ch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i.u-ch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i.u-ch.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}