mac adb環境變數配置
1、找到mac 下adb的路徑:
在cmd命令下:
首先說一下命令的用法 touch filename
常用用法:touchfilename
如果filename存在,使用touch指令可更改這個檔案或目錄的日期時間,包括存取時間和更改時間;
如果filename不存在,touch指令會在當前目錄下新建一個空白檔案filename。
1) touch .bash_profile
2) open .bash_profile
開啟一個文字檔案,如果是新建立的一般為空
再這個檔案配置以下adb的路徑資訊
export PATH=${PATH}:sdkpath/platform-tools,其中sdkpath 是自己的idk的真實路徑。
如果預設shell換成zsh
則在.zshrc 加入adb的路徑資訊
3)關閉並儲存這個檔案,再次輸入命令adb,會看到如下資訊 ,配置成功
Android Debug Bridge version 1.0.32
Revision 09a0d98bebce-android
-a - directs adb to listen on all interfaces for a connection
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <specific device> - directs command to the device or emulator with the given
serial number or qualifier. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
-H - Name of adb server host (default: localhost)
-P - Port of adb server (default: 5037)