ios-deploy也是一個(gè)終端安裝和調(diào)試iPhone應(yīng)用的是第三方開(kāi)源庫(kù)替裆,使用時(shí)需要開(kāi)發(fā)者證書(shū)和Xcode7以上版本匿沛。
1. 安裝ios-deploy
我們用npm
來(lái)安裝ios-deploy
凭戴,如果Mac上沒(méi)有秧骑,先安裝node
:
brew install node
安裝node
干甚渣淤?因?yàn)楝F(xiàn)在版本比較新的node
都自帶npm
哇均抽。
接下來(lái)愉快地安裝ios-deploy
:
npm install -g ios-deploy
2. ios-deploy常用命令
2.1 查看連接的設(shè)備(包括通過(guò)usb和wifi連接的)
ios-deploy -c
2.2 查看通過(guò)usb連接的設(shè)備
ios-deploy -c --no-wifi
2.3 安裝應(yīng)用到指定設(shè)備(其中xxx.app是Xcode編譯后的ipa的路徑)
ios-deploy --id [udid] --bundle [xxx.app]
2.4 卸載指定設(shè)備上的應(yīng)用(根據(jù)包名,也就是bundleId)
ios-deploy --id [udid] --uninstall_only --bundle_id [bundleId]
2.5 查看指定設(shè)備上安裝的所有應(yīng)用(包括系統(tǒng)應(yīng)用和第三方)
ios-deploy --id [udid] --list_bundle_id
2.6 檢查指定設(shè)備上是否安裝了某個(gè)應(yīng)用
ios-deploy --id [udid] --exists --bundle_id
3. ios-deploy的幫助項(xiàng)(Option):
-d, --debug launch the app in lldb after installation
-i, --id <device_id> the id of the device to connect to
-c, --detect only detect if the device is connected
-b, --bundle <bundle.app> the path to the app bundle to be installed
-a, --args <args> command line arguments to pass to the app when launching it
-t, --timeout <timeout> number of seconds to wait for a device to be connected
-u, --unbuffered don't buffer stdout
-n, --nostart do not start the app when debugging
-I, --noninteractive start in non interactive mode (quit when app crashes or exits)
-L, --justlaunch just launch the app and exit lldb
-v, --verbose enable verbose output
-m, --noinstall directly start debugging without app install (-d not required)
-p, --port <number> port used for device, default: dynamic
-r, --uninstall uninstall the app before install (do not use with -m; app cache and data are cleared)
-9, --uninstall_only uninstall the app ONLY. Use only with -1 <bundle_id>
-1, --bundle_id <bundle id> specify bundle id for list and upload
-l, --list list files
-o, --upload <file> upload file
-w, --download download app tree
-2, --to <target pathname> use together with up/download file/tree. specify target
-D, --mkdir <dir> make directory on device
-R, --rm <path> remove file or directory on device (directories must be empty)
-V, --version print the executable version
-e, --exists check if the app with given bundle_id is installed or not
-B, --list_bundle_id list bundle_id
-W, --no-wifi ignore wifi devices
--detect_deadlocks <sec> start printing backtraces for all threads periodically after specific amount of seconds