electricbubble / gidevice-cli

gidevice cli ( like `libimobiledevice` )
MIT License
56 stars 12 forks source link

receive packet: InvalidService #1

Closed prife closed 3 years ago

prife commented 3 years ago

run on windows 10 with usbmuxed built by myself.

PS D:\workplace\gidevice-cli> .\gidevice-cli.exe list 8a8358e12e0306cc804f4367d9152fb795e3b561 8a8358e12e0306cc804f4367d9152fb795e3b561: receive packet: InvalidService

手机信息为iPhoneX,系统版本14.0.1。 iConsole没有这个问题。对比了一下,代码里对14版本以上的手机调整了通信的服务导致错误。

InstrumentsSecureProxyServiceName = "com.apple.instruments.remoteserver.DVTSecureSocketProxy"

lockdown.go里

func (c *lockdown) InstrumentsService() (instruments Instruments, err error) {
    service := libimobiledevice.InstrumentsServiceName
    if DeviceVersion(c.iOSVersion...) >= DeviceVersion(14, 0, 0) {
        service = libimobiledevice.InstrumentsSecureProxyServiceName
    }

    var innerConn InnerConn
    if innerConn, err = c._startService(service, nil); err != nil {
        return nil, err
    }
    instrumentsClient := libimobiledevice.NewInstrumentsClient(innerConn)
    instruments = newInstruments(instrumentsClient)

    if service == libimobiledevice.InstrumentsServiceName {
        _ = innerConn.DismissSSL()
    }

    if err = instruments.notifyOfPublishedCapabilities(); err != nil {
        return nil, err
    }

    return
}
electricbubble commented 3 years ago
  1. iOS设备 需要先开启 开发者模式 才可以使用后续的 Service

可通过以下两种方式进行 开发者镜像 挂载

# 指定文件夹下存放对应 `iOS版本` 的开发者镜像与签名文件 *.dmg & *.signature
$ gidevice mount -d=/path/.../DeviceSupport/14.4/
# 参数1: `dmg` 的存放路径, 参数2: `signature` 的存放路径
$ gidevice mount /path/.../DeviceSupport/14.4/DeveloperDiskImage.dmg /path/.../DeviceSupport/14.4/DeveloperDiskImage.dmg.signature
  1. 我在 gidevice list 命令里使用了相关 Service. 当设备 未挂载 开发者镜像 时会出现 InvalidService 这样的错误
  2. mount list 有一个小bug... 我刚修复了...😥麻烦使用 v0.0.3 的版本进行 mount
prife commented 3 years ago

感谢支持,对iOS不太熟,挂载DeviceSupport后命令工作了。