1)显示隐藏文件
defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder
2)编辑文件
vim 文件路径
然后退出的时候按住 ECS,输入:wq
3)mac 机器多开unity
1、cd ~ 进入unity安装用户目录
cd /Applications/Unity/Unity.app
2、多开unity
open -n /applications/Unity/Unity.app
4)判断字符串是否相等
build_type="Debug"
if [ "$3" = "release" ];then
build_type="Release"
fi
5)文件操作
#删除文件
rm -rf 路径 :删除文件
cp -r 原路径 后路径 拷贝文件
#拷贝文件夹
cp -r ${PROJECT_PATH}/Assets/StreamingAssets_android/. ${PROJECT_PATH}/Assets/StreamingAssets
#拷贝文件
cp -f ${APK_PATH}/*.apk ${New_APK_PATH}/${productName}_${DATE}.apk
#创建文件夹
mkdir $New_APK_PATH
6)创建alias本地化命令
.bash_profile 是用户登陆时的环境变量的文本
touch命令用来修改文件的访问时间、修改时间。如果没有指定时间,则将文件时间属性改为当前时间。当指定文件不存在,则touch命令变为创建该文件。
open 打开软件
pkill -f 名字 强制关闭软件
#进入主目录
cd $HOME
touch .bash_profile:创建或者修改文件
vim .bash_profile :编辑
source .bash_profile :使配置生肖
配置内容:
alias AndroidStudio="open -a /Applications/Android\ Studio.app"
alias CloseAndroidStudio="pkill -f Android\ Studio.app"
这样在bash里面就可以使用了,但是在shell里面使用必须强制声明,否则无法使用
sh脚本里面使用AndroidStudio,
必须先加上:
cd $HOME
source .bash_profile