Skip to content

工具‐前期准备

rev1si0n edited this page Oct 1, 2023 · 1 revision

这些工具正常情况下只能工作于 linux/mac 系统之上,为个人常用功能的封装,并未特意考虑兼容 Windows 但是这不代表 lamda 不支持。如果你使用的是 Windows,以.sh结尾的脚本应该无法正常工作。

开始之前,请确保已经启动设备上的 LAMDA 服务端。部分命令文档可能具有时效性随时更新,为了避免版本问题,继续前请务必先在手机上安装最新版本的 lamda 以及其 Python 库和依赖库。部分功能需要使用 adb,请务必确保安装的 adb 是最新版本。

# 如果没有安装,请 自行搜索 如何安装,这里提供的只是基础建议
# Windows
https://developer.android.com/studio/releases/platform-tools
# Mac
brew install android-platform-tools
#brew cask install android-platform-tools
# Debian/Ubuntu
apt install adb

克隆代码到本地

git clone https://github.com/rev1si0n/lamda.git
# 如果不会使用或未安装 git,下载此文件到本地并解压
# https://github.com/rev1si0n/lamda/archive/refs/heads/master.zip

进入 tools 目录并安装所需的依赖包

# 切换到 tools/ 目录并执行
pip3 install -r requirements.txt

如果你在服务端启用了通信加密(certificate),你需要在使用前设置环境变量 CERTIFICATE

# 对于 linux / Mac
export CERTIFICATE=/path/to/lamda.pem
# 对于 Windows(路径不能包含空格)
set CERTIFICATE=C:\Users\path\to\lamda.pem

如果你修改了 lamda 的默认端口 65000,也需要在使用前设置环境变量

# 对于 linux / Mac
export PORT=8123
# 对于 Windows(路径不能包含空格)
set PORT=8123

192.168.1.2 为示例IP,请自行获取设备的实际IP地址。