MacOS Installation 推荐
About 585 wordsAbout 2 min
2025-07-11
一、node环境安装
1、检查系统是否已安装 Node.js node -v npm -v 2、通过 Homebrew 安装 安装brew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 安装node brew install node 命令行配置文件里添加环境变量
Homebrew
export PATH="/opt/homebrew/bin:PATH"eval"(/opt/homebrew/bin/brew shellenv)"
二、appium安装
1、appium安装
sudo npm install -g appium
2、appium驱动安装
sudo appium driver install uiautomator2 sudo appium driver install xcuitest
3、确保当前用户(xiaojunping)对目录/Users/xiaojunping/.appium具有写入权限
sudo chown -R $(whoami) /Users/xiaojunping/.appium
4、appium-inspector 安装
https://github.com/appium/appium-inspector/releases
三、MongoDB安装
1、MongoDB安装
brew tap mongodb/brew brew install mongodb-community@6.0
2、启动 MongoDB
brew services start mongodb/brew/mongodb-community@6.0
3、验证 MongoDB 是否运行
brew services list
4、让mongodb数据库支持局域网访问
4.1、修改/opt/homebrew/etc/mongod.conf中的net配置 net: bindIp: 0.0.0.0 port: 27017 ipv6: true 4.2、重启数据库 brew services restart mongodb/brew/mongodb-community@6.0
四、拉取代码
https://gitlab.autel.com/energy/mobile/aigc/auco/smarttest/smartinspector.git https://gitlab.autel.com/energy/mobile/aigc/auco/testcase/client.git https://gitlab.autel.com/energy/mobile/aigc/auco/testcase/server.git 进入每个项目代码目录执行启动 npm 目录权限设置 sudo chown -R 501:20 /Users/xping/.npm
1、client:
npm install npm run dev
2、server:
npm install npm run dev 如果有端口冲突,改.env文件的PORT字段 检测端口冲突命令: Lsof -i :3000
3、smartinspector:
需要改成本机ip地址 [图片]
npm install npm install -g pm2 node server.js 或者 npm run pm2:start
五、安装android开发环境
1、下载android studio,下载sdk
https://developer.android.com/studio?hl=zh-cn
2、bash环境变量配置
#android export ANDROID_SDK_HOME="/Users/skyfend/Library/Android/sdk" export ANDROID_HOME=ANDROIDSDKHOMEexportANDROIDSDKROOT={ANDROID_SDK_HOME} export PATH=PATH:{ANDROID_SDK_HOME}/platform-tools
六、安装ios开发环境
1、ios证书安装
2、安装ios相关工具
brew install libimobiledevice xcode-select --install brew install carthage iproxy 8100 8100 xcode-select --print-path sudo xcode-select --reset sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
3、appium-xcuitest-driver项目路径:
/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver { "platformName": "iOS", "app": "com.autel.charge", "udid": "00008101-001E35683A08001E", "automationName": "XCUITest", "wdaLaunchTimeout": 60000 }
4、下载和安装其他 Xcode 组件
https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components
七、FFMPEG安装
ffmpeg -version brew install ffmpeg
八、python 环境安装
1、安装pyenv
brew update brew install pyenv brew install openssl readline sqlite3 xz zlib
2、配置 shell 环境
在你的 ~/.zshrc 文件中添加以下内容: export PYENV_ROOT="HOME/.pyenv"exportPATH="PYENV_ROOT/bin:PATH"eval"(pyenv init --path)" eval "$(pyenv init -)"
3、执行以下命令
source ~/.zshrc
4、检查是否安装成功
pyenv --version
5、安装3.12.3版本
pyenv install 3.12.3
6、设置全局版本为:3.12.3
pyenv global 3.12.3
7、验证当前生效的版本
python --version
8、在smartinspector目录下运行
pip install -r requirements.txt
