常用的Shell
想知道你的系统有几种shell,可以通过以下命令查看:
cat /etc/shells
显示如下:
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
切换bash(需要sudo)
chsh -s /bin/bash
切换zsh(不需要sudo)
chsh -s /bin/zsh
“zsh: command not found: adb” 解决方法:
前提
已经成功安装了 Android Studio.
打开 iTerm 终端依次输入下面命令:
echo 'export ANDROID_HOME=/Users/$USER/Library/Android/sdk' >> ~/.zshrc
echo 'export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >> ~/.zshrc
source ~/.zshrc
echo 'GRADLE_HOME=/Applications/Android\ Studio.app/Contents/gradle/gradle-4.6' >> ~/.zshrc
echo 'export PATH={GRADLE_HOME}/bin' >> ~/.zshrc
Mac下命令行下 报 env: bash\r: No such file or directory
我是从window下拷贝的 react-native 项目执行 react-native run-android 时候报 env: bash\r: No such file or directory
解决办法
1、brew install dos2unix
2、find . -type f -exec dos2unix {} \;
Gradle-命令笔记
用来分析依赖包的结构:
apply plugin: 'project-report'
gradle htmlDependencyReport
open app/build/reports/project/dependencies/index.html
查看所有任务
./gradlew tasks --all
对某个module [moduleName] 的某个任务[TaskName] 运行
./gradlew :moduleName:taskName
查看构建版本
./gradlew -v
清除build文件夹
./gradlew clean
检查依赖并编译打包
./gradlew build
编译并安装debug包
./gradlew installDebug
编译并打印日志
./gradlew build --info
调试模式构建并打印日志
./gradlew build --info --debug --stacktrace
强制更新最新依赖,清除构建并构建
./gradlew clean --refresh-dependencies build
编译并打Debug包
./gradlew assembleDebug
./gradlew aD
编译并打Release的包
./gradlew assembleRelease
./gradlew aR
编译并打Debug包
./gradlew assembleDebug
编译app module 并打Debug包
./gradlew install app:assembleDebug
编译并打Release的包
./gradlew assembleRelease
Release模式打包并安装
./gradlew installRelease
卸载Release模式包
./gradlew uninstallRelease
</article>
网友评论