node 权限问题

问 题:
Error: EACCES: permission denied
解决方案:
sudo npm i gulp-imagemin -g --unsafe-perms
或者
1、创建一个目录用作全局安装:
mkdir ~/.npm-global
2、配置npm使用这个新目录:
npm config set prefix '~/.npm-global'
3、打开(没有就创建)一个“~/.profile”文件到你的全局目录下并添加下行代码(这一步不在命令行操作,而在你新创建的文件下添加):
export PATH=~/.npm-global/bin:$PATH
4、返回命令行,更新系统变量:
source ~/.profile

npm install xxx -g 提示:command not found

问 题:未设置npm环境变量
解决方案:
将 npm全局路径添加到环境变量中
vim ~/.bash_profile
#npm
export PATH=/Users/admin/.npm-global/bin:$PATH
source .bash_profile

Android SDK权限

问 题1:
You have not accepted the license agreements of the following SDK components
解决方案:
$ yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
这时候有可能遇到另外一个问题:
Error:Unknown argument --licenses
这是sdkmanager需要升级
$ yes | $ANDROID_HOME/tools/bin/sdkmanager --update

iOS macaca-ios

  1. stderr: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
  2. xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
  3. Install fail! RunScriptError: Run "sh -c ./src/scripts/check_reqs.js && xcodebuild" error, exit code 1
  4. RunScriptError: Run "sh -c ./src/scripts/check_reqs.js && xcodebuild" error, exit code 1
  5. at ChildProcess.<anonymous> (/Users/xiongjunjie/.npm-global/lib/node_modules/cnpm/node_modules/runscript/index.js:96:21)
  6. at ChildProcess.emit (events.js:315:20)
  7. at maybeClose (internal/child_process.js:1026:16)
  8. at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

解决:
报这个错误的原因是xcode-select不在默认的路径1.找到xcode-select的当前路径终端命令行

  1. xcode-select --print-path
  2. /Library/Developer/CommandLineTools

2.设置xcode-select到指定位置

  1. sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/

3.验证是否设置成功

  1. xcode-select --print-path
  2. /Applications/Xcode.app/Contents/Developer

iOS真机证书安装

Macaca:
项目路径:/Users/admin/.npm-global/lib/node_modules/macaca-ios/node_modules/xctestwd

Fork最新依赖:

  1. $ Carthage update --platform iOS

此时可能遇到另外一个问题

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/quezhi/Library/Caches/org.carthage.CarthageKit/DerivedData/13.0_13A233/AEXML/4.6.1/Build/Intermediates.noindex/ArchiveIntermediates/AEXML tvOS/IntermediateBuildFilesPath/UninstalledProducts/appletvos/AEXML.framework/AEXML and /Users/quezhi/Library/Caches/org.carthage.CarthageKit/DerivedData/13.0_13A233/AEXML/4.6.1/Build/Products/Release-appletvsimulator/AEXML.framework/AEXML have the same architectures (arm64) and can't be in the same fat output file

后面加上$ Carthage update --platform iOS --use-xcframeworks 即可
image.png

Xcode 打开项目,登录开发者账号,证书签名

Appium:
项目路径:/Users/admin/.npm-global/lib/node_modules/appiu/node_modules/appium-webdriveragent
Fork最新依赖:

$sh ./Scripts/bootstrap.sh

Xcode 打开项目,登录开发者账号,证书签名