-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 41fd114
Showing
62 changed files
with
7,253 additions
and
0 deletions.
There are no files selected for viewing
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 electricbubble | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,102 @@ | ||
# Golang-iDevice | ||
|
||
## Installation | ||
|
||
```shell script | ||
go get github.com/electricbubble/gidevice | ||
``` | ||
|
||
#### Devices | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
giDevice "github.com/electricbubble/gidevice" | ||
"log" | ||
) | ||
|
||
func main() { | ||
usbmux, err := giDevice.NewUsbmux() | ||
if err != nil { | ||
log.Fatalln(err) | ||
} | ||
|
||
devices, err := usbmux.Devices() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
for _, dev := range devices { | ||
log.Println(dev.Properties().SerialNumber, dev.Properties().ProductID, dev.Properties().DeviceID) | ||
} | ||
} | ||
|
||
``` | ||
|
||
|
||
#### XCTest | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
giDevice "github.com/electricbubble/gidevice" | ||
"log" | ||
"sync" | ||
"time" | ||
) | ||
|
||
func main() { | ||
usbmux, err := giDevice.NewUsbmux() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
devices, err := usbmux.Devices() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
if len(devices) == 0 { | ||
log.Fatal("No Device") | ||
} | ||
|
||
dev := devices[0] | ||
|
||
out, cancel, err := dev.XCTest("com.leixipaopao.WebDriverAgentRunner.xctrunner") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
var wg sync.WaitGroup | ||
wg.Add(1) | ||
|
||
go func() { | ||
for s := range out { | ||
fmt.Print(s) | ||
} | ||
}() | ||
|
||
go func() { | ||
time.Sleep(10 * time.Second) | ||
cancel() | ||
log.Println("DONE") | ||
wg.Done() | ||
}() | ||
|
||
wg.Wait() | ||
} | ||
|
||
``` | ||
|
||
## Thanks | ||
|
||
| |About| | ||
|---|---| | ||
|[libimobiledevice/libimobiledevice](https://github.com/libimobiledevice/libimobiledevice)|A cross-platform protocol library to communicate with iOS devices| | ||
|[anonymous5l/iConsole](https://github.com/anonymous5l/iConsole)|iOS usbmuxd communication impl iTunes protocol| | ||
|[alibaba/taobao-iphone-device](https://github.com/alibaba/taobao-iphone-device)|tidevice can be used to communicate with iPhone device| | ||
|
||
Thank you [JetBrains](https://www.jetbrains.com/?from=gwda) for providing free open source licenses |
Oops, something went wrong.