前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >关于Mac上使用ideviceinstaller操作iPhoneXR等24位UDID设备报“ERROR: Invalid UDID specified”解决办法

关于Mac上使用ideviceinstaller操作iPhoneXR等24位UDID设备报“ERROR: Invalid UDID specified”解决办法

作者头像
周希
发布2019-10-15 15:33:00
1.2K0
发布2019-10-15 15:33:00
举报
文章被收录于专栏:APP自动化测试APP自动化测试

最近新申请了一台iPhone XR, 测试时发现使用ideviceinstaller命令老是报错:

代码语言:javascript
复制
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位UDID

看了下ideviceinstaller官方仓库 https://github.com/libimobiledevice/ideviceinstaller

最新的代码已经解决了这个问题, 所以我们需要是用源码安装最新的版本

如果只下载ideviceinstaller源码进行安装的话会提示libimobiledevice版本低了, 所以我们需要把libimobiledevice跟ideviceinstaller都使用最新的源码安装下

以下是操作步骤:

1.如果当前的libimobiledevice跟ideviceinstaller不能正常使用, 可以使用以下方式恢复

代码语言:javascript
复制
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 ***安装下再重试就可以了; 如果只是提示安装失败就一般再试一次就可以

2.下载libimobiledevice源码

代码语言:javascript
复制
git clone https://github.com/libimobiledevice/libimobiledevice.git

进入libimobiledevice代码路径, 执行

代码语言:javascript
复制
./autogen.sh --disable-openssl

会提示缺少依赖, 使用brew install --HEAD ***安装下再重试

执行

代码语言:javascript
复制
make
sudo make install

3.下载ideviceinstaller源码

代码语言:javascript
复制
git clone https://github.com/libimobiledevice/ideviceinstaller.git

进入ideviceinstaller代码路径, 执行

代码语言:javascript
复制
./autogen.sh --disable-openssl
make
sudo make install

这样就OK了, 再试试操作手机

代码语言:javascript
复制
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

大功告成

代码语言:javascript
复制
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-04-18 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档