Open prife opened 1 year ago
pymobileservice3 与go-ios中API对等异同
def perform_handshake(self):
args = MessageAux()
args.append_obj({'com.apple.private.DTXBlockCompression': 0, 'com.apple.private.DTXConnection': 1})
self.send_message(0, '_notifyOfPublishedCapabilities:', args, expects_reply=False)
ret, aux = self.recv_plist()
if ret != '_notifyOfPublishedCapabilities:':
raise ValueError('Invalid answer')
if not len(aux[0]):
raise ValueError('Invalid answer')
self.supported_identifiers = aux[0].value
类似的go-ios代码
func (d *Channel) MethodCallAsync(selector string, args ...interface{}) error {
payload, _ := nskeyedarchiver.ArchiveBin(selector)
auxiliary := NewPrimitiveDictionary()
for _, arg := range args {
auxiliary.AddNsKeyedArchivedObject(arg)
}
err := d.Send(false, Methodinvocation, payload, auxiliary)
if err != nil {
log.WithFields(log.Fields{"channel_id": d.channelName, "error": err, "methodselector": selector}).Info("failed starting invoking method")
return err
}
return nil
}
2.1比如这里必须生成两次,一个config用两次必崩溃,绝对是它序列化程序写的有问题
2.2 这个1秒不能少,否则能拉起进程,但是test不执行
2.3 这里go-ios写错了
err = ideDaemonProxy2.daemonConnection.startExecutingTestPlanWithProtocolVersion(ideInterfaceChannel, 25)
但是startExecutingTestPlanWithProtocolVersion这个函数的实现根本不需要传什么对象
func (xdc XCTestManager_DaemonConnectionInterface) startExecutingTestPlanWithProtocolVersion(channel *dtx.Channel, version uint64) error {
return channel.MethodCallAsync("_IDE_startExecutingTestPlanWithProtocolVersion:", version)
}
代码已经推送到wdb分支
目标
参考资料