Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ bin
offline
config.json
logs
view_log
wda_wrapper/go.sum
temp
dist.tgz
cache/*
Expand Down
27 changes: 14 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ repos/osx_ios_device_trigger/osx_ios_device_trigger/main.cpp: | repos/osx_ios_de

# --- VIEW LOG ---

view_log: view_log.go
go get github.com/fsnotify/fsnotify
go get github.com/sirupsen/logrus
go build view_log.go
view_log: view_log/view_log

view_log_sources: $(wildcard view_log/*.go)

view_log/view_log: $(view_log_sources)
$(MAKE) -C view_log

# --- H264_TO_JPEG ---

Expand Down Expand Up @@ -202,7 +204,6 @@ bin/ios_video_pull: repos/ios_video_pull/ios_video_pull
# --- WDA / WebDriverAgent ---

repos/WebDriverAgent/Carthage/Checkouts/RoutingHTTPServer/Info.plist: | repos/WebDriverAgent
cd repos/WebDriverAgent && ./Scripts/bootstrap.sh

wda: bin/wda/build_info.json

Expand Down Expand Up @@ -270,7 +271,7 @@ clone: repos/WebDriverAgent repos/osx_ios_device_trigger repos/stf-ios-provider
repos/stf-ios-provider/package.json: repos/stf-ios-provider

repos/stf-ios-provider:
$(eval REPO=$(shell jq '.repo_stf // "https://github.com/nanoscopic/stf-ios-provider.git"' config.json -j))
$(eval REPO=$(shell if test -f config.json; then jq '.repo_stf // "https://github.com/nanoscopic/stf-ios-provider.git"' -j config.json; else echo "https://github.com/nanoscopic/stf-ios-provider.git"; fi))
git clone $(REPO) repos/stf-ios-provider --branch master

repos/ios_video_stream:
Expand All @@ -282,8 +283,8 @@ repos/ios_video_pull:
repos/WebDriverAgent/WebDriverAgent.xcodeproj: repos/WebDriverAgent

repos/WebDriverAgent:
$(eval REPO=$(shell jq '.repo_wda // "https://github.com/appium/WebDriverAgent.git"' config.json -j))
$(eval REPO_BR=$(shell jq '.repo_wda_branch // "master"' config.json -j))
$(eval REPO=$(shell if test -f config.json; then jq '.repo_wda // "https://github.com/appium/WebDriverAgent.git"' -j config.json; else echo "https://github.com/appium/WebDriverAgent.git"; fi))
$(eval REPO_BR=$(shell if test -f config.json; then jq '.repo_wda_branch // "master"' -j config.json; else echo "master"; fi))
git clone $(REPO) repos/WebDriverAgent --branch $(REPO_BR)

repos/osx_ios_device_trigger:
Expand Down Expand Up @@ -334,7 +335,7 @@ repos/libimobiledevice/Makefile: | repos/libimobiledevice
stf: repos/stf-ios-provider/package-lock.json

repos/stf-ios-provider/package-lock.json: repos/stf-ios-provider/package.json
cd repos/stf-ios-provider && PATH="/usr/local/opt/node@12/bin:$(PATH)" npm install
cd repos/stf-ios-provider && PATH="/usr/local/opt/node@14/bin:$(PATH)" npm install
touch repos/stf-ios-provider/package-lock.json

# --- OFFLINE STF ---
Expand Down Expand Up @@ -406,17 +407,14 @@ dist.tgz: offline/build_info.json ios_video_stream wda device_trigger halias bin
@if [ ! -f offline/logs/openvpn.log ]; then touch offline/logs/openvpn.log; fi;
tar -h -czf dist.tgz $(distfiles) -C offline $(offlinefiles)

clean: cleanstf cleanwda cleanlogs cleanivs cleanwdaproxy cleanrunner
clean: cleanwda cleanviewlog cleanlogs cleanivs cleanwdaproxy cleanrunner
$(MAKE) -C coordinator clean
$(RM) build_info.json

cleanwdaproxy:
$(MAKE) -C repos/wdaproxy clean
$(RM) bin/wdaproxy

cleanstf:
$(MAKE) -C repos/stf clean

cleanivs:
$(MAKE) -C repos/ios_video_stream clean
$(RM) bin/ios_video_stream
Expand All @@ -432,6 +430,9 @@ cleanwda:
cleanrunner:
$(MAKE) -C runner clean

cleanviewlog:
$(MAKE) -C view_log clean

cleanlogs:
$(RM) logs/*
touch logs/.gitkeep
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## STF IOS Support

[Actual instruction for deploy service on 2023/08/09](docs/DEPLOYMENT.md)

### Prerequisites
1. A machine running MacOS ( to build and run the "provider" )
1. A machine running Linux with Docker container support ( to run the STF server )
Expand Down
26 changes: 11 additions & 15 deletions coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,25 +832,21 @@ func event_loop(

if devd != nil && !devd.wdaStarted {
o.config = devd.confDup

if !o.config.Video.Enabled ||
( o.devd.okVidInterface == true && o.devd.okFirstFrame == true ) ||
videoMethod == "app" {
o.devd.wdaStarted = true

o.devd.wdaStarted = true

time.Sleep( time.Second * 2 )
time.Sleep( time.Second * 2 )

fmt.Printf("trying to get ios version\n")
fmt.Printf("trying to get ios version\n")

log.WithFields( log.Fields{
"type": "ios_version",
"dev_name": o.devd.name,
"dev_uuid": uuid,
"ios_version": o.devd.iosVersion,
} ).Debug("IOS Version")
log.WithFields( log.Fields{
"type": "ios_version",
"dev_name": o.devd.name,
"dev_uuid": uuid,
"ios_version": o.devd.iosVersion,
} ).Debug("IOS Version")

proc_wdaproxy( o, devEventCh, false )
}
proc_wdaproxy( o, devEventCh, false )
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions coordinator/go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module coordinator.go

go 1.12
go 1.16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any issue with updating the base requirement to 1.16. I am curious if there is any specific need to do so?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was generated on version 16, left it as it is.
Reason - 1.12 is deprecated and more unavailable in Homebrew:
https://formulae.brew.sh/formula/go#default

1.16 now the most wounding available version


require (
github.com/elastic/go-sysinfo v1.4.0
github.com/fsnotify/fsnotify v1.4.7
github.com/go-cmd/cmd v1.2.0
github.com/jviney/go-proc v0.2.0
github.com/nanoscopic/ujsonin v1.9.0
github.com/sirupsen/logrus v1.4.2
github.com/elastic/go-sysinfo v1.8.1
github.com/fsnotify/fsnotify v1.6.0
github.com/go-cmd/cmd v1.4.1
github.com/nanoscopic/ujsonin v1.13.0
github.com/sirupsen/logrus v1.9.0
github.com/zeromq/goczmq v4.1.0+incompatible
)
2 changes: 1 addition & 1 deletion coordinator/proc_device_unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func proc_device_ios_unit( o ProcOptions, uuid string, curIP string) {
return true
}
o.procName = "stf_device_ios"
o.binary = "/usr/local/opt/node@12/bin/node"
o.binary = "/usr/local/opt/node@14/bin/node"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does latest STF now require node 14? I set it this way just because it was what was installed on my machine. Really this should be changed to auto-detect which Node is installed and use the latest acceptable version. ( which may not be the latest if STF itself doesn't support the latest. )

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node@12 now is more unavailable in Homebrew:
https://formulae.brew.sh/formula/node#default

For this reason, the version is raised to the minimum accessible and check working provider on node@14.

Current used version NodeJS in STF view 17:
https://github.com/DeviceFarmer/stf/blob/master/Dockerfile-debian-x86_64#L29

I think that updating the version of NodeJs is actually better done as part of a separate task. There is a PR about this:
#118

o.startDir = "./repos/stf-ios-provider"
proc_generic( o )
}
Expand Down
2 changes: 1 addition & 1 deletion coordinator/proc_stf_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func proc_stf_provider( o ProcOptions, curIP string ) {
"server_hostname": serverHostname,
"location": location,
}
o.binary = "/usr/local/opt/node@12/bin/node"
o.binary = "/usr/local/opt/node@14/bin/node"
o.args = []string {
"--inspect=127.0.0.1:9230",
"runmod.js" , "provider",
Expand Down
4 changes: 2 additions & 2 deletions coordinator/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func cleanup_procs(config *Config) {
}*/

// node --inspect=[ip]:[port] runmod.js device-ios
if cmd[0] == "/usr/local/opt/node@12/bin/node" && cmd[3] == "device-ios" {
if cmd[0] == "/usr/local/opt/node@14/bin/node" && cmd[3] == "device-ios" {
pid := proc.PID()

plog.WithFields( log.Fields{
Expand All @@ -78,7 +78,7 @@ func cleanup_procs(config *Config) {
}

// node --inspect=[ip]:[port] runmod.js provider
if cmd[0] == "/usr/local/opt/node@12/bin/node" && cmd[3] == "provider" {
if cmd[0] == "/usr/local/opt/node@14/bin/node" && cmd[3] == "provider" {
pid := proc.PID()

plog.WithFields( log.Fields{
Expand Down
Loading