Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix some bug when install and run xcuitest & supoort context in forwa…
…rd and xcuitestrunner & add fsync (#144) * fix: install ipa failed below iOS 10 * fix: run xcuitest failed bug * support context and export StartNewProxyConnection in forward * support fsync * fix: house_arrest connection close failed when it is nil * support context in xcuitestrunner Co-authored-by: colerwang <colerwang@tencent.com>
- Loading branch information
1 parent
89cfb69
commit 94f24f8
Showing
16 changed files
with
1,044 additions
and
443 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
package afc | ||
|
||
/* | ||
const test_device_udid = "your device udid" | ||
func TestConnection_Remove(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
err = conn.Remove("/DCIM/goios") | ||
if err != nil { | ||
log.Fatalf("remove failed:%v", err) | ||
} | ||
} | ||
func TestConnection_Mkdir(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
err = conn.MkDir("/DCIM/TestDir") | ||
if err != nil { | ||
log.Fatalf("mkdir failed:%v", err) | ||
} | ||
} | ||
func TestConnection_stat(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
si, err := conn.Stat("/DCIM/architecture_diagram.png") | ||
if err != nil { | ||
log.Fatalf("get Stat failed:%v", err) | ||
} | ||
log.Printf("Stat :%+v", si) | ||
} | ||
func TestConnection_listDir(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
flist, err := conn.listDir("/DCIM/") | ||
if err != nil { | ||
log.Fatalf("tree view failed:%v", err) | ||
} | ||
for _, v := range flist { | ||
fmt.Printf("path: %+v\n", v) | ||
} | ||
} | ||
func TestConnection_TreeView(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
err = conn.TreeView("/DCIM/", "", true) | ||
if err != nil { | ||
log.Fatalf("tree view failed:%v", err) | ||
} | ||
} | ||
func TestConnection_pullSingleFile(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
err = conn.PullSingleFile("/DCIM/architecture_diagram.png", "architecture_diagram.png") | ||
if err != nil { | ||
log.Fatalf("pull single file failed:%v", err) | ||
} | ||
} | ||
func TestConnection_Pull(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
srcPath := "/DCIM/" | ||
dstpath := "TempRecv" | ||
dstpath = path.Join(dstpath, srcPath) | ||
err = conn.Pull(srcPath, dstpath) | ||
if err != nil { | ||
log.Fatalf("pull failed:%v", err) | ||
} | ||
} | ||
func TestConnection_Push(t *testing.T) { | ||
deviceEnrty, _ := ios.GetDevice(test_device_udid) | ||
conn, err := New(deviceEnrty) | ||
if err != nil { | ||
log.Fatalf("connect service failed: %v", err) | ||
} | ||
srcPath := "your src path" | ||
dstpath := "your dst path" | ||
err = conn.Push(srcPath, dstpath) | ||
if err != nil { | ||
log.Fatalf("push failed:%v", err) | ||
} | ||
} | ||
*/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.