Skip to content

Commit

Permalink
fix: get all data correctly
Browse files Browse the repository at this point in the history
> #27
  • Loading branch information
electricbubble committed May 20, 2022
1 parent c92932c commit dc3d391
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
19 changes: 19 additions & 0 deletions device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,22 @@ func Test_device_Shutdown(t *testing.T) {
setupDevice(t)
dev.Shutdown()
}

func Test_device_InstallationProxyBrowse(t *testing.T) {
setupDevice(t)

list, err := dev.InstallationProxyBrowse(
WithApplicationType(ApplicationTypeUser),
WithReturnAttributes("CFBundleDisplayName", "CFBundleIdentifier", "SequenceNumber", "SequenceNumber"),
)
// list, err := dev.InstallationProxyBrowse()
if err != nil {
t.Fatal(err)
}

t.Log(len(list))

for _, l := range list {
t.Logf("%#v", l)
}
}
5 changes: 2 additions & 3 deletions installationproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,16 @@ func (p *installationProxy) Browse(opts ...InstallationProxyOption) (currentList
return nil, err
}

currentList = reply.CurrentList

for reply.Status != "Complete" {
if respPkt, err = p.client.ReceivePacket(); err != nil {
return nil, err
}
if err = respPkt.Unmarshal(&reply); err != nil {
return nil, err
}
currentList = append(currentList, reply.CurrentList)
}

currentList = reply.CurrentList
return
}

Expand Down

0 comments on commit dc3d391

Please sign in to comment.