首页 文章 精选 留言 我的

精选列表

搜索[mac os],共10000篇文章
优秀的个人博客,低调大师

cocos2d-x在mac下配置安卓开发环境

前言: 我们都知道cocos2d-x是一个跨平台的游戏引擎,但如果只用它来开发iPone/iPad端的游戏,有点太杀鸡用牛刀了,如果是那样的话,cocos2d-x就没有展现出它的优势了。那我就来介绍一下用cocos2d-x如何创建一个安卓平台,并且成功的将ios游戏项目转化成安卓游戏。 操作步骤: 在中断输入pico .bash_profile打开之后输入export ANDROID_SDK_ROOT=/Users/Himi/Documents/HimiWork/AndroidTools/android-sdk$export ANDROID_NDK_ROOT=/Users/Himi/Documents/HimiWork/AndroidTools/android-ndk$export COCOS2DX_ROOT=/Users/Himi/Documents/cocos2d-1.0.1-x-0.12.0export NDK_ROOT=/Users/Himi/Documents/HimiWork/AndroidTools/android-ndk-r7bexport PATH=$PATH:$ANDROID_SDK_ROOTexport PATH=$PATH:$ANDROID_NDK_ROOT然后按住Ctrl+X->Y+回车结束路径配置然后新建一个xcode项目,如果是新添加了类之后,必须确保所有的类文件都在class中,然后重新编译,确保项目能在iPhone模拟器中正常运行接着是在终端运行cocos2d-x中的create-android-project.sh,新建项目,项目名称com.dxw.test,然后选择id2,接着文件名test。然后将proj.android中的build_native.sh修改一下路径:将../../修改成../libs,接着将四个文件分别复制到自己的项目libs中,有的需要覆盖。最后看一下自己的项目中platform中最后java/libs是否包含好多java文件,如果没有的话,就自己从cocos2d-x中找到相应的文件然后复制就可以了如果是自己额外创建的项目: 要修改jni下的mk文件: 将LOCAL_SRC_FILES:=hellocpp/main.cpp... , 将所有项目中cpp文件都添加进去 然后对proj.andorid进行清理,删除掉assert和obj文件删除,然后继续./build_native.sh进行编译 注意点: 1.要修改cocos2dx项目中的AppDelegate.cpp, applicationDidFinishLaunching的方法下面添加一行:CCEGLView::sharedOpenGLView()->setDesignResolutionSize(320,480,kResolutionUnKnown); //屏幕分辨率自适应 2.修改eclipse下的一个AndroidManifest.xml文件,因为他默认的是横屏的(LandScape),如果是纵屏的话要修改成竖屏(android:screenOrientation="portrait")显示。 测试: 将文件分别import到工程中,首先导入proj.android然后是libcocos2dx文件,最后插上手机进行运行! 本文转蓬莱仙羽51CTO博客,原文链接:http://blog.51cto.com/dingxiaowei/1366269,如需转载请自行联系原作者

优秀的个人博客,低调大师

Mac下Android Studio中获取SHA1和MD5

有很多人讲这个的时候,老是只把这个代码标出来又不说为什么 keytool -list -keystore debug.keystore keytool 这个是java的jdk中一个工具(做签名文件也用到了这个) 打开AndroidStudio中的Terminal,也可以直接打开系统的 获取debug.keystore的SHA1和MD5 keytool -list -v -keystore ~/.android/debug.keystore -aliasandroiddebugkey -storepass android -keypass android 获取其他keystore的,如正式签名文件的 keytool -list -v -keystore ~/User/你的用户名/debug.keystore -aliasandroiddebugkey -storepass android -keypass android 需要把路径和密码改成相应的就可以了 本文转自 一点点征服 博客园博客,原文链接:http://www.cnblogs.com/ldq2016/p/5552245.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

Mac OSX - 如何在bash_profile中配置全局环境变量

我们知道,在Linux操作系统下,配置环境变量是使用如下命令: vim /etc/profile 在OSX下,我们用如下命令打开环境变量配置文件: open ~/.bash_profile 典型的环境变量配置如下: # java export JAVA_HOME = /home/myuser/jdk1.7.0_03 export PATH = $JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar # hadoop export HADOOP_HOME=/Users/YourUserName/Documents/Dev/hadoop-2.7.3 export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin # spunk export SPLUNK_HOME=/Applications/Splunk export PATH=$PATH:$SPLUNK_HOME/bin # Setting PATH for Python 3.5 # The original version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}" export PATH export CLASSPATH=${CLASSPATH}:/Users/YourUserName/Documents/Lib/hadoop_cli # ant export ANT_HOME=/Users/YourUserName/Documents/Dev/apache-ant-1.9.7 export PATH=$PATH:${ANT_HOME}/bin # JBOSS export JBOSS_HOME=/Users/YourUserName/Documents/Dev/wildfly-10.1.0.Final export PATH=$PATH:$JBOSS_HOME/bin # M2_HOME export M2_HOME=/Users/YourUserName/Documents/Dev/apache-maven-3.3.9 export PATH=$PATH:$M2_HOME/bin 最后,别忘了编译下 source .bash_profile

优秀的个人博客,低调大师

Hadoop - Mac OSX下配置和启动hadoop以及常见错误解决

0. 安装JDK 参考网上教程在OSX下安装jdk 1. 下载及安装hadoop a) 下载地址: http://hadoop.apache.org b)配置ssh环境 在terminal里面输入: ssh localhost 如果有错误提示信息,表示当前用户没有权限。这个多半是系统为安全考虑,默认设置的。 更改设置如下:进入system preference --> sharing --> 勾选remote login,并设置allow access for all users。 再次输入“ssh localhost",再输入密码并确认之后,可以看到ssh成功。 c) ssh免登陆配置 命令行输入: ssh-keygen-tdsa-P''-f~/.ssh/id_dsa ssh-keygen表示生成秘钥;-t表示秘钥类型;-P用于提供密语;-f指定生成的秘钥文件。 这个命令在”~/.ssh/“文件夹下创建两个文件id_dsa和id_dsa.pub,是ssh的一对儿私钥和公钥。 接下来,将公钥追加到授权的key中去,输入: cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys ******************************************************************************** 免密码登录localhost 1. ssh-keygen -t rsa Press enter for each line 提示输入直接按回车就好 2. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 3. chmod og-wx ~/.ssh/authorized_keys 测试ssh localhost如果仍然提示要输入密码,那么可以vim ~/.ssh/config文件,添加以下代码。 Host localhost AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa 测试ssh localhost,不再提示需要输入密码。 ******************************************************************************** d) 设置环境变量 在实际启动Hadoop之前,有三个文件需要进行配置。但在这之前,我们需要在我们的bash_profile中配置如下几个配置 命令行输入: open ~/.bash_profile; # hadoopexport HADOOP_HOME=/Users/YourUserName/Documents/Dev/hadoop-2.7.3export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin e) 配置hadoop-env.sh 在${HADOOP_HOME}/etc/hadoop目录下,找到hadoop-env.sh,打开编辑确认如下设置是否正确: export JAVA_HOME=${JAVA_HOME} export HADOOP_HEAPSIZE=2000(去掉注释)export HADOOP_OPTS="-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk"(去掉注释) f)配置core-site.xml——指定了NameNode的主机名与端口 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>/Users/YourUserName/Documents/Dev/hadoop-2.7.3/hadoop-${user.name}</name> <value>hdfs://localhost:9000</value> <description>A base for other temporary directories.</description> </property> <property> <name>fs.default.name</name> <value>hdfs://localhost:8020</value> </property> </configuration> g)配置hdfs-site.xml——指定了HDFS的默认参数副本数,因为仅运行在一个节点上,所以这里的副本数为1 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration> h)配置mapred-site.xml——指定了JobTracker的主机名与端口 <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>mapred.job.tracker</name> <value>hdfs://localhost:9001</value> </property> <property> <name>mapred.tasktracker.map.tasks.maximum</name> <value>2</value> </property> <property> <name>mapred.tasktracker.reduce.tasks.maximum</name> <value>2</value> </property> </configuration> i)安装HDFS 经过以上的配置,就可以进行HDFS的安装了 命令行输入: cd $HADOOP_HOME/bin hadoop namenode -format 如果出现下图,说明你的HDFS已经安装成功了 j)启动Hadoop cd ${HADOOP_HOME}/sbin start-dfs.sh start-yarn.sh k) 验证hadoop 如果在启动过程中没有发生任何错误 启动完成之后,在命令行输入: jps 如果结果如下: 3761 DataNode4100 Jps3878 SecondaryNameNode3673 NameNode4074 NodeManager3323 ResourceManager 以上几个节点都打印出来,那么恭喜你,你已经成功安装和启动hadoop了! 最后,我们可以在浏览器通过http的方式进行验证 浏览器输入: http://localhost:8088/ 结果如下: 浏览器输入: http://localhost:50070/ 结果如下: 2. 常见错误解决 hadoop namenode不能启动 org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /tmp/hadoop-javoft/dfs/name is in an inconsistent state: storage di rectory does not exist or is not accessible. 原因在于core-site.xml你必须覆盖hadoop.tmp.dir为你自己的hadoop目录... hadoop.tmp.dir /home/javoft/Documents/hadoop/hadoop-${user.name}

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

用户登录
用户注册