Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit a18e992
Author: ZhouYixun <291028775@qq.com>
Date:   Tue Sep 13 10:05:53 2022 +0800

    feat:rm_armv6

commit 55d9877
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 10:38:51 2022 +0800

    Update release.yml

commit 62c7db2
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 10:30:35 2022 +0800

    Update version.go

commit 1c21340
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 10:30:11 2022 +0800

    Update release.yml

commit 40959aa
Author: ZhouYixun <291028775@qq.com>
Date:   Wed Sep 7 01:46:05 2022 +0800

    feat: version check

commit f757dfe
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:42:58 2022 +0800

    Update test.yml

commit 169b554
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:41:04 2022 +0800

    Update test.yml

commit a08f518
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:32:05 2022 +0800

    Update test.yml

commit 2d85424
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:26:06 2022 +0800

    Update test.yml

commit e18a0bf
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:23:03 2022 +0800

    Update test.yml

commit e0fa5ca
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:19:48 2022 +0800

    Update test.yml

commit e614092
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:17:50 2022 +0800

    Update test.yml

commit 6e1bca9
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:14:17 2022 +0800

    Update test.yml

commit a91b2a8
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:06:41 2022 +0800

    Update test.yml

commit 9d2e950
Author: Eason <291028775@qq.com>
Date:   Wed Sep 7 01:05:36 2022 +0800

    Update test.yml

commit 5d74004
Author: ZhouYixun <291028775@qq.com>
Date:   Wed Sep 7 00:53:09 2022 +0800

    test actions3

commit 472ea13
Author: ZhouYixun <291028775@qq.com>
Date:   Wed Sep 7 00:52:38 2022 +0800

    test actions3

commit a702b9c
Author: ZhouYixun <291028775@qq.com>
Date:   Wed Sep 7 00:48:19 2022 +0800

    test actions2

commit ae2bacb
Author: ZhouYixun <291028775@qq.com>
Date:   Wed Sep 7 00:41:50 2022 +0800

    test actions

commit d07a80a
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 20:42:04 2022 +0800

    Update release.yml

commit a1bd000
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 20:33:21 2022 +0800

    Update pr-labeler.yml

commit 2202321
Author: ZhouYixun <291028775@qq.com>
Date:   Mon Sep 5 20:19:04 2022 +0800

    fix: release version

commit 589c34a
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:33:00 2022 +0800

    Update pr-labeler.yml

commit 6020511
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:27:19 2022 +0800

    Update pull-request-template.md

commit 7c4d2e4
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:24:19 2022 +0800

    Update pull-request-template.md

commit bff1ef7
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:21:31 2022 +0800

    Update pr-labeler.yml

commit d964d56
Merge: de6edc6 e696001
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:20:38 2022 +0800

    Merge pull request SonicCloudOrg#38 from aoliaoaoaojiao/fix_output

    #fix output

commit de6edc6
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:16:45 2022 +0800

    Update pr-labeler.yml

commit e696001
Author: 奥利嗷嗷嗷叫 <go3011739322@gmail.com>
Date:   Mon Sep 5 16:09:10 2022 +0800

    fix output

commit e26c7c3
Author: Eason <291028775@qq.com>
Date:   Mon Sep 5 16:01:51 2022 +0800

    Create pr-labeler.yml

commit 0b0ef8f
Author: Eason <291028775@qq.com>
Date:   Sat Sep 3 23:04:40 2022 +0800

    Update release.yml

commit 9df055e
Author: ZhouYixun <291028775@qq.com>
Date:   Sat Sep 3 22:55:52 2022 +0800

    fix: mount fail on 12.5

commit 2eccb4a
Author: Eason <291028775@qq.com>
Date:   Sat Sep 3 21:09:38 2022 +0800

    Update go-lint.yml

commit 67d90b7
Author: Eason <291028775@qq.com>
Date:   Sat Sep 3 21:09:17 2022 +0800

    Update go-lint.yml

commit a68cef4
Author: ZhouYixun <291028775@qq.com>
Date:   Sat Sep 3 21:06:26 2022 +0800

    feat: pre release

commit 5916895
Merge: d82c004 a76a870
Author: Eason <291028775@qq.com>
Date:   Sat Sep 3 20:59:16 2022 +0800

    Merge pull request SonicCloudOrg#37 from SonicCloudOrg/feat-get-perform

    Feat get perform

commit a76a870
Author: ZhouYixun <291028775@qq.com>
Date:   Sat Sep 3 20:56:02 2022 +0800

    fix: some better

commit d82c004
Merge: 9cb559e 716fed8
Author: Eason <291028775@qq.com>
Date:   Sat Sep 3 20:47:54 2022 +0800

    Merge pull request SonicCloudOrg#36 from SonicCloudOrg/fix/wda_connection

    Fix/wda connection

commit 716fed8
Author: ZhouYixun <291028775@qq.com>
Date:   Sat Sep 3 20:46:39 2022 +0800

    fix: xctest

commit 0b75854
Author: ZhouYixun <291028775@qq.com>
Date:   Sat Sep 3 20:17:48 2022 +0800

    try_fix_connection

commit 1ee4b65
Author: ZhouYixun <291028775@qq.com>
Date:   Thu Sep 1 00:42:02 2022 +0800

    fix: xctest

commit 2a49f47
Merge: 9cb559e ca6ba16
Author: Eason <291028775@qq.com>
Date:   Sat Aug 27 23:43:54 2022 +0800

    Merge pull request SonicCloudOrg#32 from aoliaoaoaojiao/main

    增加性能命令-初版

commit ca6ba16
Author: 奥利奥嗷嗷叫 <go3011739322@gmail.com>
Date:   Sat Aug 27 11:19:01 2022 +0800

    修改引用

commit b1945af
Author: 奥利奥嗷嗷叫 <go3011739322@gmail.com>
Date:   Sat Aug 27 01:16:30 2022 +0800

    增加性能方法

# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
aoliaoaoaojiao committed Sep 19, 2022
1 parent 88271cf commit 4901cf9
Show file tree
Hide file tree
Showing 14 changed files with 348 additions and 182 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug------bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug 报告 | Bug report
about: Create a report to help us improve
title: "【Bug】"
labels: bug
assignees: ''

---

**在提出此issue时,我确认了以下几点(保存后请点击复选框):**

- [ ] 我已自己确认这是Sonic自身的Bug。
- [ ] 我接受此issue可能被关闭,并查看开发人员的建议。

**Bug 描述**
清晰地描述Bug的情况与详细复现步骤 | A clear and concise description of what the bug is.

**版本**
Sonic的版本号 | Sonic's Version.
部署的系统(mac,windows32...) | System

13 changes: 13 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
alwaysReplace: true
customLabels:
- text: 'fix'
label: 'fix'
- text: 'feature'
label: 'feature'
- text: 'feat'
label: 'feature'
- text: 'bug'
label: 'fix'
- text: 'doc'
label: 'document'
searchBody: false
8 changes: 8 additions & 0 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**在提出此拉取请求时,我确认了以下几点(保存后请点击复选框):**

- [ ] 标题为fix、feat或doc开头
- [ ] 我已检查没有与此请求重复的拉取请求。
- [ ] 我已经考虑过,并确认这份呈件对其他人很有价值。
- [ ] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。

**填写PR内容:**
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Go Build

on: [pull_request]

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Go lint Check

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- "v*.*.*"

jobs:
release:
Expand All @@ -12,15 +14,22 @@ jobs:
with:
fetch-depth: 0

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18

- name: replace version
run: ver=${{ steps.previoustag.outputs.tag }} && new_ver=${ver:1} && sed -i "s/SONIC_VERSION/${new_ver}/g" cmd/version.go

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: release --rm-dist --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ builds:
goarch:
- "386"
- amd64
- arm
- arm64
archives:
- replacements:
Expand Down
109 changes: 109 additions & 0 deletions cmd/perfmon.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* Copyright (C) [SonicCloudOrg] Sonic Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package cmd

import (
"fmt"
"github.com/SonicCloudOrg/sonic-ios-bridge/src/entity"
"github.com/SonicCloudOrg/sonic-ios-bridge/src/util"
giDevice "github.com/electricbubble/gidevice"
"github.com/spf13/cobra"
"os"
"os/signal"
"strconv"
)

var pefmonCmd = &cobra.Command{
Use: "perfmon",
Short: "Get perfmon from your device.",
Long: "Get perfmon from your device.",
RunE: func(cmd *cobra.Command, args []string) error {
device := util.GetDeviceByUdId(udid)
if device == nil {
os.Exit(0)
}
if appName != "" && pid != -1 {
fmt.Println("pid and appName cannot be used at the same time")
os.Exit(0)
}
if appName != "" {
var err error
pid, err = util.GetApplicationPID(device, appName)
if err != nil {
os.Exit(0)
}
}
util.CheckMount(device)
var opts = &giDevice.PerfmonOption{
PID: strconv.Itoa(pid),
OpenChanMEM: getMEM,
OpenChanNetWork: getNetWork,
OpenChanCPU: getCPU,
OpenChanFPS: getFPS,
OpenChanGPU: getGPU,
}
output, cancelFunc, err := device.GetPerfmon(opts)

if err != nil {
fmt.Println(err)
os.Exit(0)
}
done := make(chan os.Signal, 1)
signal.Notify(done)
// add timer?

for {
select {
case <-done:
if cancelFunc != nil {
cancelFunc()
}
return nil
default:
if data, ok := <-output; ok {
d := util.ResultData(entity.CreatePerformanceData(data))
fmt.Println(util.Format(d, isFormat, isJson))
}
}
}
return nil
},
}

var (
getCPU bool
getGPU bool
getMEM bool
getFPS bool
getNetWork bool
pid int
appName string
)

func init() {
rootCmd.AddCommand(pefmonCmd)
pefmonCmd.Flags().StringVarP(&udid, "udid", "u", "", "device's serialNumber ( default first device )")
pefmonCmd.Flags().IntVarP(&pid, "pid", "p", -1, "get PID data")
pefmonCmd.Flags().StringVarP(&appName, "app-name", "a", "", "get app data ( Valid for memory and CPU only )")
pefmonCmd.Flags().BoolVar(&getCPU, "cpu", false, "get cpu data")
pefmonCmd.Flags().BoolVar(&getMEM, "mem", false, "get memory data")
pefmonCmd.Flags().BoolVar(&getGPU, "gpu", false, "get gpu data")
pefmonCmd.Flags().BoolVar(&getFPS, "fps", false, "get fps data")
pefmonCmd.Flags().BoolVar(&getNetWork, "network", false, "get networking data")
pefmonCmd.Flags().BoolVarP(&isFormat, "format", "f", false, "convert to JSON string and format")
pefmonCmd.Flags().BoolVarP(&isJson, "json", "j", false, "convert to JSON string")
}
29 changes: 21 additions & 8 deletions cmd/run/wda.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,26 @@ var wdaCmd = &cobra.Command{
shutWdaDown := make(chan os.Signal, syscall.SIGTERM)
signal.Notify(shutWdaDown, os.Interrupt, os.Kill)

go func() {
for s := range output {
fmt.Print(s)
if strings.Contains(s, "ServerURLHere->") {
fmt.Println("WebDriverAgent server start successful")
if !disableShowLog {
go func() {
for {
select {
case s, ok := <-output:
if ok {
fmt.Print(s)
if strings.Contains(s, "ServerURLHere->") {
fmt.Println("WebDriverAgent server start successful")
}
} else {
return
}
case <-shutWdaDown:
return
}
}
}
shutWdaDown <- os.Interrupt
}()
shutWdaDown <- os.Interrupt
}()
}

<-shutWdaDown
stopTest()
Expand All @@ -120,11 +131,13 @@ var (
serverLocalPort int
mjpegLocalPort int
disableMjpegProxy bool
disableShowLog bool
)

func initWda() {
runRootCMD.AddCommand(wdaCmd)
wdaCmd.Flags().BoolVarP(&disableMjpegProxy, "disable-mjpeg-proxy", "", false, "disable mjpeg-server proxy")
wdaCmd.Flags().BoolVarP(&disableShowLog, "disable-show-log", "", false, "disable print wda logs")
wdaCmd.Flags().StringVarP(&udid, "udid", "u", "", "device's serialNumber ( default first device )")
wdaCmd.Flags().StringVarP(&wdaBundleID, "bundleId", "b", "com.facebook.WebDriverAgentRunner.xctrunner", "WebDriverAgentRunner bundleId")
wdaCmd.Flags().IntVarP(&serverRemotePort, "server-remote-port", "", 8100, "WebDriverAgentRunner server remote port")
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var versionCmd = &cobra.Command{
Short: "Version code of sib",
Long: "Version code of sib",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("1.1.8")
fmt.Println("SONIC_VERSION")
},
}

Expand Down
32 changes: 2 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,17 @@ module github.com/SonicCloudOrg/sonic-ios-bridge
go 1.18

require (
github.com/SonicCloudOrg/sonic-ios-webkit-adapter v0.0.7-0.20220917125600-2502f70d3a3b
github.com/electricbubble/gidevice v0.6.2
github.com/gin-gonic/gin v1.8.1
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.5.0
github.com/mitchellh/mapstructure v1.5.0
github.com/satori/go.uuid v1.2.0
github.com/spf13/cobra v1.4.0
howett.net/plist v1.0.0
)

replace github.com/electricbubble/gidevice v0.6.2 => github.com/SonicCloudOrg/sonic-gidevice v0.0.0-20220827051900-b54b5c523e71
replace github.com/electricbubble/gidevice v0.6.2 => github.com/SonicCloudOrg/sonic-gidevice v0.6.2

require (
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.0 // indirect
github.com/goccy/go-json v0.9.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tidwall/gjson v1.14.3 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/yezihack/e v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
howett.net/plist v1.0.0 // indirect
)
Loading

0 comments on commit 4901cf9

Please sign in to comment.