Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
remove tunnel server, use androidx.test.runner instead of android.sup…
Browse files Browse the repository at this point in the history
…port.test.runner
  • Loading branch information
codeskyblue committed Mar 23, 2021
1 parent e4c73b0 commit 1fdd3bf
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ import (
"net"
"net/http"
"net/http/httputil"
"net/url"
"os"
"os/exec"
"os/signal"
"os/user"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -528,7 +526,7 @@ func main() {
fStop := cmdServer.Flag("stop", "stop server").Bool()
cmdServer.Flag("addr", "listen port").Default(":7912").StringVar(&listenAddr) // Create on 2017/09/12
cmdServer.Flag("log", "log file path when in daemon mode").StringVar(&daemonLogPath)
fServerURL := cmdServer.Flag("server", "server url").Short('t').String()
// fServerURL := cmdServer.Flag("server", "server url").Short('t').String()
fNoUiautomator := cmdServer.Flag("nouia", "do not start uiautoamtor when start").Bool()

// CMD: version
Expand Down Expand Up @@ -574,17 +572,17 @@ func main() {
}
}

serverURL := *fServerURL
if serverURL != "" {
if !regexp.MustCompile(`https?://`).MatchString(serverURL) {
serverURL = "http://" + serverURL
}
u, err := url.Parse(serverURL)
if err != nil {
log.Fatal(err)
}
_ = u
}
// serverURL := *fServerURL
// if serverURL != "" {
// if !regexp.MustCompile(`https?://`).MatchString(serverURL) {
// serverURL = "http://" + serverURL
// }
// u, err := url.Parse(serverURL)
// if err != nil {
// log.Fatal(err)
// }
// _ = u
// }

if _, err := os.Stat("/sdcard/tmp"); err != nil {
os.MkdirAll("/sdcard/tmp", 0755)
Expand Down Expand Up @@ -680,7 +678,8 @@ func main() {
Args: []string{"am", "instrument", "-w", "-r",
"-e", "debug", "false",
"-e", "class", "com.github.uiautomator.stub.Stub",
"com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner"},
"com.github.uiautomator.test/androidx.test.runner.AndroidJUnitRunner"}, // update for android-uiautomator-server.apk>=2.3.2
//"com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner"},
Stdout: os.Stdout,
Stderr: os.Stderr,
MaxRetries: 1, // only once
Expand Down

0 comments on commit 1fdd3bf

Please sign in to comment.