最近新申請了一臺iPhone XR, 測試時發現使用ideviceinstaller命令總是報錯:git
Jackeys-MacBook-Pro:~ jackey$ ideviceinstaller -u 00008020-xxxxxxxxxxxx -U com.xxxx.xxxxxxxx ERROR: Invalid UDID specified Usage: ideviceinstaller OPTIONS Manage apps on iOS devices. -u, --udid UDID Target specific device by its 40-digit device UDID. -l, --list-apps List apps, possible options: -o list_user - list user apps only (this is the default) -o list_system - list system apps only -o list_all - list all types of apps -o xml - print full output as xml plist -i, --install ARCHIVE Install app from package file specified by ARCHIVE. ARCHIVE can also be a .ipcc file for carrier bundles. -U, --uninstall APPID Uninstall app specified by APPID. -g, --upgrade ARCHIVE Upgrade app from package file specified by ARCHIVE. -L, --list-archives List archived applications, possible options: -o xml - print full output as xml plist -a, --archive APPID Archive app specified by APPID, possible options: -o uninstall - uninstall the package after making an archive -o app_only - archive application data only -o docs_only - archive documents (user data) only -o copy=PATH - copy the app archive to directory PATH when done -o remove - only valid when copy=PATH is used: remove after copy -r, --restore APPID Restore archived app specified by APPID -R, --remove-archive APPID Remove app archive specified by APPID -o, --options Pass additional options to the specified command. -h, --help prints usage information -d, --debug enable communication debugging
提示udid錯誤, ideviceinstaller只支持40位UDIDgithub
看了下ideviceinstaller官方倉庫 https://github.com/libimobiledevice/ideviceinstallerapp
最新的代碼已經解決了這個問題, 因此咱們須要是用源碼安裝最新的版本ide
若是隻下載ideviceinstaller源碼進行安裝的話會提示libimobiledevice版本低了, 因此咱們須要把libimobiledevice跟ideviceinstaller都使用最新的源碼安裝下測試
如下是操做步驟:this
1.若是當前的libimobiledevice跟ideviceinstaller不能正常使用, 能夠使用如下方式恢復spa
brew uninstall --ignore-dependencies libimobiledevice brew uninstall --ignore-dependencies usbmuxd brew install --HEAD usbmuxdbrew unlink usbmuxd brew link usbmuxdbrew install --HEAD libimobiledevice brew install ideviceinstaller brew link --overwrite ideviceinstaller
安裝過程當中可能會提示缺乏後一個庫, 使用brew install --HEAD ***安裝下再重試就能夠了; 若是隻是提示安裝失敗就通常再試一次就能夠debug
2.下載libimobiledevice源碼rest
git clone https://github.com/libimobiledevice/libimobiledevice.git
進入libimobiledevice代碼路徑, 執行code
./autogen.sh --disable-openssl
會提示缺乏依賴, 使用brew install --HEAD ***安裝下再重試
執行
make
sudo make install
3.下載ideviceinstaller源碼
git clone https://github.com/libimobiledevice/ideviceinstaller.git
進入ideviceinstaller代碼路徑, 執行
./autogen.sh --disable-openssl
make
sudo make install
這樣就OK了, 再試試操做手機
Jackeys-MacBook-Pro:ideviceinstaller jackey$ ideviceinstaller -u 00008020-xxxxxxxxxxxxx -U com.xxxxxxx.xxxxxxx Uninstalling 'com.xxxxxxx.xxxxxxxxx' Uninstall: RemovingApplication (50%) Uninstall: GeneratingApplicationMap (90%) Uninstall: Complete
大功告成