openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.38k stars 2.79k forks source link

IOS Support #1142

Closed nanoscopic closed 3 years ago

nanoscopic commented 4 years ago

Is your feature request related to a problem? Please describe. There are a variety of currently existing implementations of IOS support for OpenSTF. One of them is https://github.com/tmobile/stf_ios_support There are others also. None of their code has been accepted into the openstf namespace, with the exception of the https://github.com/openstf/ios-minicap

It seems weird that there is neither a branch nor any code in the OpenSTF namespace to begin working on IOS support with other users/contributors to OpenSTF.

I'm concerned that the commerically running contributors / sponsors are intentionally ignoring IOS support as they want to prevent a free version from working well and being widely available/understood.

If that is not the case, I would like to start getting IOS support upstreamed; at the very least in a branch. If discussions on how to do this need to happen first, lets begin having those discussions.

If it is the case that the core contributors / sponsors refuse to support IOS or allow development to continue in an open collective way on the openstf namespace, then that should be stated clearly so that an effort to do that can be done elsewhere.

Describe the solution you'd like Do one of the following:

  1. Say that openstf namespace refuses to support IOS ( then it can continue elsewhere )
  2. Say that openstf namespace wants IOS support but wants to have conversation about how to go about it properly first ( and have that conversation here in this new issue rather than on the existing huge issue full of technical conversation )
  3. Say that openstf namespace wants IOS support, and decide on a branch and begin letting PRs go into it so that work can begin in the namespace.
  4. Something else that allows work to happen as a community.

Describe alternatives you've considered

  1. Starting a fork of OpenSTF entirely and driving the community to that, away from the openstf namespace. ( I don't want to see this happen; as the OpenSTF project is great and the community should stick together in the same place )
  2. Starting other Wikis / webpages to develop the IOS STF efforts there, without involving the main OpenSTF project. ( I don't like this solution, because it will lead to a fragmented ecosystem of developers on OpenSTF and over time could lead to project divergence )

Additional context I think what I'm asking for is clear with the above info? If not would be happy to address any questions and/or start conversation about this.

P.S. I and my fellow coworkers love OpenSTF and appreciate it's existence and the work that goes into it. ❤️

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

koral-- commented 4 years ago

What do you exactly mean by branch? repo https://github.com/tmobile/stf_ios_support is not a fork of this one.

nanoscopic commented 4 years ago

Code needs to be added to OpenSTF to make IOS support work well. The stf_ios_support repo is two things:

  1. A central coordinator that controls all the bits and pieces that need to run for an IOS provider to work
  2. A collection of scripts and build utilities to build everything needed

The build portion of it downloads and builds github.com/tmobile/stf That repo is a fork of stf, and the ios-support branch there is a branch. It contains the device-ios unit: https://github.com/tmobile/stf/tree/ios-support/lib/units/device-ios

The device-ios unit specifically can be and is meant to be contributed via pull request to OpenSTF.

It wouldn't make much sense though to have the device-ios unit in the openstf namespace without one of the following:

  1. Having documentation explaining where to get the stf_ios_support in setup guide for OpenSTF.
  2. Having the stf_ios_support repo also within the openstf namespace

There are a few reasons I have not already submitted a PR against openstf of the device-ios unit:

  1. It is somewhat useless without all the other stuff; and I'm not sure those should go into the openstf/stf repo because the coordinator in stf_ios_support is written in Go. It could be weird having an entirely different language in the same project. Also the build process for stf_ios_support is totally different than the process for stf itself.
  2. There is at least one major alternative to the device-ios unit I've been working on; and that is the mrx ios-device unit ( https://github.com/tmobile/stf/tree/ios-support/lib/units/device-ios ) The device-ios unit I've created is based in part on that code but changed to work specifically with stf_ios_support.
  3. Besides the stf_ios_support repo, and the stf fork, there are a handful of other repos that stf_ios_support checks out and uses. If code is contributed and goes into the openstf namespace, I somewhat feel that all the necessary bits should be in the openstf namespace somewhere. I am not clear on the process of how to contribute all of those things, or if those in control of the namespace even want all this stuff there. I want to work together in harmony with the OpenSTF project, and upstream what parts are possible.

Essentially, I'm not clear how to go about getting all the bits contributed into openstf namespace somewhere so that it is clear that the OpenSTF community is welcome to move forward with a path. I additionally don't want to ignore the other possibility ( mrx repo ), if that is desired instead.

The other issue I pointed out above is that I've seen posts that lead me to believe that the OpenSTF project does not want working IOS code integrated. I'm hoping this is a misunderstanding on my part and would like a clear answer on that, such as "no we would like to get collective community work going on IOS support"

koral-- commented 4 years ago

Thanks for detailed explanation. I'll play with this solution from you/tmobile and give you some answer shortly. Regarding mrx repo, I've checked it few weeks ago I've finally managed to get it working but it required some manual changes in code I think it is in too early stage to integrate it with official repo.

YauheniRusinchuk commented 4 years ago

How do I click on the settings button on a click to open the settings on the iOS screen? And then I broke my whole head)

koral-- commented 4 years ago

@nanoscopic I've tried to build stf_ios_support using make but it is failing for me with the following errors:

cd repos/WebDriverAgent && ./Scripts/bootstrap.sh
Fetching dependencies
Dependencies up-to-date
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C repos/wdaproxy
go get . & exit 0
go get ./... & exit 0
go build .
installer.go:7:2: cannot find package "github.com/DHowett/go-plist" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/DHowett/go-plist (from $GOROOT)
    /Users/openatx/go/src/github.com/DHowett/go-plist (from $GOPATH)
main.go:18:2: cannot find package "github.com/facebookgo/freeport" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/facebookgo/freeport (from $GOROOT)
    /Users/openatx/go/src/github.com/facebookgo/freeport (from $GOPATH)
main.go:23:2: cannot find package "github.com/gobuild/log" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/gobuild/log (from $GOROOT)
    /Users/openatx/go/src/github.com/gobuild/log (from $GOPATH)
main.go:19:2: cannot find package "github.com/gorilla/mux" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/gorilla/mux (from $GOROOT)
    /Users/openatx/go/src/github.com/gorilla/mux (from $GOPATH)
provider.go:16:2: cannot find package "github.com/gorilla/websocket" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/gorilla/websocket (from $GOROOT)
    /Users/openatx/go/src/github.com/gorilla/websocket (from $GOPATH)
httplog.go:8:2: cannot find package "github.com/mash/go-accesslog" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/mash/go-accesslog (from $GOROOT)
    /Users/openatx/go/src/github.com/mash/go-accesslog (from $GOPATH)
main.go:21:2: cannot find package "github.com/ogier/pflag" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/ogier/pflag (from $GOROOT)
    /Users/openatx/go/src/github.com/ogier/pflag (from $GOPATH)
provider.go:17:2: cannot find package "github.com/openatx/wdaproxy/connector" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/openatx/wdaproxy/connector (from $GOROOT)
    /Users/openatx/go/src/github.com/openatx/wdaproxy/connector (from $GOPATH)
main.go:22:2: cannot find package "github.com/openatx/wdaproxy/web" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/openatx/wdaproxy/web (from $GOROOT)
    /Users/openatx/go/src/github.com/openatx/wdaproxy/web (from $GOPATH)
main.go:24:2: cannot find package "github.com/shurcooL/vfsgen" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/shurcooL/vfsgen (from $GOROOT)
    /Users/openatx/go/src/github.com/shurcooL/vfsgen (from $GOPATH)
revproxy.go:18:2: cannot find package "github.com/sirupsen/logrus" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/sirupsen/logrus (from $GOROOT)
    /Users/openatx/go/src/github.com/sirupsen/logrus (from $GOPATH)
make[1]: *** [wdaproxy] Error 1
make: *** [repos/wdaproxy/wdaproxy] Error 2
Mac-mini-openatx:stf_ios_support openatx$ # cd /Users/openatx/go/src/github.com/DHowett/go-plist; git pull --ff-only
From https://github.com/DHowett/go-plist
 * branch            HEAD       -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    .gitlab-ci.yml
    LICENSE
    README.md
    bplist.go
    bplist_generator.go
    bplist_parser.go
    bplist_test.go
    cmd/experimental/plait/plait.go
    cmd/experimental/plait/web/index.html
    cmd/experimental/plait/web/ply.js
    cmd/experimental/plait/web/ply_exec.js
    cmd/ply/README.md
    cmd/ply/ply.go
    cmd/ply/prettyprint.go
    common_data_for_test.go
    decode.go
    decode_test.go
    doc.go
    encode.go
    encode_test.go
    example_custom_marshaler_test.go
    fuzz.go
    go.mod
    go16_test.go
    go17_test.go
    invalid_bplist_test.go
    invalid_text_test.go
    marshal.go
    marshal_test.go
    must.go
    plist.go
    plist_types.go
    testdata/xml_unusual_cases/s01.plist
    testdata/xml_unusual_cases/s02.plist
    testdata/xml_unusual_cases/s03.plist
    testdata/xml_unusual_cases/s04.plist
    testdata/xml_unusual_cases/s05.plist
    testdata/xml_unusual_cases/s06.plist
    testdata/xml_unusual_cases/s07.plist
    testdata/xml_unusual_cases/s08.plist
    testdata/xml_unusual_cases/s09.plist
    testdata/xml_unusual_cases/s10.plist
    testdata/xml_unusual_cases/s11.plist
    text_generator.go
    text_parser.go
    text_tables.go
    text_test.go
    typeinfo.go
    unmarshal.go
    unmarshal_test.go
    util.go
    xml_generator.go
    xml_parser.go
    xml_test.go
    zerocopy.go
    zerocopy_appengine.go
Please move or remove them before you merge.
Aborting
package github.com/DHowett/go-plist: exit status 1
# cd /Users/openatx/go/src/github.com/facebookgo/freeport; git pull --ff-only
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

package github.com/facebookgo/freeport: exit status 1
# cd /Users/openatx/go/src/github.com/gobuild/log; git pull --ff-only
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

package github.com/gobuild/log: exit status 1
# cd /Users/openatx/go/src/github.com/gorilla/mux; git pull --ff-only
From https://github.com/gorilla/mux
 * branch            HEAD       -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    .circleci/config.yml

And there are more The following untracked working tree files would be overwritten by merge errors below. Any idea how to fix that? go version go1.13.5 darwin/amd64

nanoscopic commented 4 years ago

These two lines in the Makefile for wdaproxy are supposed to fetch the dependencies stated as missing:

go get . & exit 0
go get ./... & exit 0

These lines are forced to not die, because if they are run multiple times after already fetching dependencies they error out and would break the make process. As a result though, the errors from them are hidden. It is likely that you did not have internet access / connection when running make.

You can simply rerun make when you have internet access to fetch the golang dependencies of wdaproxy. Alternatively you can switch to the repos/wdaproxy folder and go get . and go get ./... yourself as see what the errors are if any and then rerun make at the root after that.

As for the weird merge errors you are getting; that would be due to the Makefile attempting to pull when it already pulled partially, got modified, and cannot merge cleanly. It appears that is coming out of a breaking change in a downstream golang dependency of wdaproxy. Hopefully simply erasing the repos/wdaproxy folder entirely and trying again should resolve that nonsense. rm -rf repos/wdaproxy

I haven't pulled and rebuilt wdaproxy anytime soon; ( in several weeks ) so it is possible downstream dependencies have broken during that time. I'll erase my own folder and see if it breaks now.

koral-- commented 4 years ago

Thanks, I removed entire ~/go directory and clean build succeeded. Now I'm getting the following error from stf-api:

2020-01-05T01:00:43.818Z INF/provider 1 [*] Receiving input from "tcp://stf.<stripped>:7250"
<stripped> - - [05/Jan/2020:01:00:52 +0000] "GET / HTTP/1.1" 304 0 "https://stf.<stripped>/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 >
<stripped> - - [05/Jan/2020:01:00:52 +0000] "GET /socket.io/?uip=<stripped>&EIO=3&transport=websocket HTTP/1.1" 101 173 "-" "Mozilla/5.0 (X11; Linux x86_>
<stripped> - - [05/Jan/2020:01:00:52 +0000] "GET /app/api/v1/state.js HTTP/1.1" 304 0 "https://stf.<stripped>/" "Mozilla/5.0 (X11; Linux x86_64) >
<stripped> - - [05/Jan/2020:01:00:52 +0000] "GET /static/app/build/entry/commons.entry.js HTTP/1.1" 304 0 "https://stf.<stripped>/" "Mozilla/5.0 >
<stripped> - - [05/Jan/2020:01:00:52 +0000] "GET /static/app/build/entry/app.entry.js HTTP/1.1" 304 0 "https://stf.<stripped>/" "Mozilla/5.0 (X11>
2020-01-05T01:00:52.916Z ERR/api:controllers:devices 1 [*] Failed to load device list:  TypeError: Cannot read property 'indexOf' of undefined
    at /app/lib/units/api/controllers/devices.js:41:32
    at Array.forEach (<anonymous>)
    at /app/lib/units/api/controllers/devices.js:39:16
From previous event:
    at /app/lib/units/api/controllers/devices.js:36:10
    at bound (domain.js:301:14)
    at runBound (domain.js:314:12)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at getDevices (/app/lib/units/api/controllers/devices.js:34:6)
    at swagger_router (/app/node_modules/swagger-node-runner/fittings/swagger_router.js:104:13)
    at Runner.<anonymous> (/app/node_modules/bagpipes/lib/bagpipes.js:171:7)
    at bound (domain.js:301:14)
    at Runner.runBound (domain.js:314:12)
    at Runner.pipeline (/app/node_modules/pipeworks/pipeworks.js:72:17)
    at Runner.flow (/app/node_modules/pipeworks/pipeworks.js:223:19)
    at Pipeworks.flow (/app/node_modules/pipeworks/pipeworks.js:135:17)
    at Pipeworks.siphon (/app/node_modules/pipeworks/pipeworks.js:186:19)
    at Runner.<anonymous> (/app/node_modules/bagpipes/lib/bagpipes.js:98:22)
    at bound (domain.js:301:14)
    at Runner.runBound (domain.js:314:12)
    at Runner.<anonymous> (/app/node_modules/pipeworks/pipeworks.js:72:17)
    at postFlight (/app/node_modules/bagpipes/lib/bagpipes.js:220:3)
    at /app/node_modules/bagpipes/lib/bagpipes.js:174:9
    at expressCompatibility (/app/node_modules/swagger-node-runner/fittings/express_compatibility.js:44:3)
    at express_compatibility (/app/node_modules/swagger-node-runner/fittings/express_compatibility.js:12:5)
From previous event:
    at accessTokenAuth (/app/lib/units/api/helpers/securityHandlers.js:81:8)
    at andCheck (/app/node_modules/swagger-node-runner/fittings/swagger_security.js:54:22)
    at /app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:356:13
    at async.forEachOf.async.eachOf (/app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:233:13)
    at _asyncMap (/app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:355:9)
    at Object.map (/app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:337:20)
    at orCheck (/app/node_modules/swagger-node-runner/fittings/swagger_security.js:40:15)
    at /app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:356:13
    at async.forEachOf.async.eachOf (/app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:233:13)
    at _asyncMap (/app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:355:9)
    at Object.map (/app/node_modules/swagger-node-runner/node_modules/async/lib/async.js:337:20)
    at swagger_security (/app/node_modules/swagger-node-runner/fittings/swagger_security.js:36:11)
    at Runner.<anonymous> (/app/node_modules/bagpipes/lib/bagpipes.js:171:7)
    at bound (domain.js:301:14)
    at Runner.runBound (domain.js:314:12)
    at Runner.<anonymous> (/app/node_modules/pipeworks/pipeworks.js:72:17)
    at postFlight (/app/node_modules/bagpipes/lib/bagpipes.js:220:3)
    at /app/node_modules/bagpipes/lib/bagpipes.js:174:9
    at /app/node_modules/swagger-node-runner/fittings/swagger_params_parser.js:43:7
nanoscopic commented 4 years ago

When / which process is the error coming from? Is it coming from the stf-provider run by the coordinator, or is that coming from the server side?

If it is coming from the server side; you can use a standard STF server with no changes; you no longer need to use the custom STF server that is built by the Makefile.

The server differences that matter are the changes to nginx configuration to allow a video path back to the provider going through the STF server hostname, and loosely the updated Dockerfile build. The Dockerfile updates are just to make it quicker to repeatedly rebuild the server side though; they aren't required.

koral-- commented 4 years ago

They are coming from server side (not from provider). Thanks, with standard upstream STF server I can see connected iphones. I'll continue playing with it. Looks very good for me now :)

nanoscopic commented 4 years ago

Great to hear. The latest changes pushed today move to using a reduced set of STF files for the provider ( this repo: https://github.com/nanoscopic/stf-ios-provider ) This makes it much easier to build the required pieces since the entirety of STF does not need to be built at the same time. This IOS provider could be more readily accepted into the openstf namespace since it won't need to be merged into the main STF project.

The latest changes also make it possible to control phones via jailbroken phones with VNC, with which clicking is immediate instead of delayed as it is when clicking goes through XCUITest.

Lots of other stability fixes and tweaks have been done as well, so it should be much more stable starting up and working properly compared to previously. Be aware that if you pull stf_ios_support you'll need to pull the independent repos under 'stf_ios_support/repos' manually because they won't be pulled automatically.

YauheniRusinchuk commented 4 years ago

By Settings button on browser page doesn't open device settings screen. How to forward a call from a client to a device?

nanoscopic commented 4 years ago

@YauheniRusinchuk Take a look at the diagram for the provider at the bottom of the wiki here: https://github.com/tmobile/stf_ios_support/wiki

When you click in a browser on the video screen the following happen:

  1. The browser sends a request to the STF server/matrix to click at that position
  2. The STF server sends that request to the STF Device Unit running on the provider machine ( it knows where to send it because the provider registers itself against the server )
  3. The STF Device Unit translates the call into a WDA ( WebDriverAgent ) command.
  4. That call goes to the WDAProxy listening on port 8000.
  5. The WDAProxy relays that command to WDA listening on localhost:8000
  6. The WDA turns that request into a XCUITest command, run through XCode
  7. XCode interacts back and forth with the phone using lockdown protocol to make a click occur.

If you use a jailbroken device, install Veency, and then enable vnc control in the config:

  1. The browser sends a request to the STF server/matrix to click at that position
  2. The STF server sends that request to the STF Device Unit running on the provider machine ( it knows where to send it because the provider registers itself against the server )
  3. The STF Device Unit translates the call into a VNC request to Veency

In the jailbroken setup, Veency is made accessible via a iproxy port forward.

Assuming you are using non-jailbroken, and clicking is not working, I'd recommend you look at the WDA log ./view_log -proc wda and see if you see any errors there.

amrsa1 commented 4 years ago

it seems awesome boost for stf looking forward for it

nanoscopic commented 4 years ago

@YauheniRusinchuk The very first click sometimes will get ignored due to a glitch with WDA sessions. This problem will be resolved soon by working around the glitch within stf-ios-provider ( https://github.com/nanoscopic/stf-ios-provider )

Also, if WDA itself is not starting up when you run the coordinator, then click will not work as WDA is needed to click on things shown in the video.

At the end of a full coordinator startup, you should see a log message like the following:

INFO[0010] WDA Running                                   coro=zmqpull proc=wdaproxy type=wda_started uuid=[uuid]

If you do not see that message, you can check the logs of wdaproxy and/or wda. ./view_log -proc wdaproxy and ./view_log -proc wda

nanoscopic commented 4 years ago

@koral-- Any update on this work from the perspective of the OpenSTF project itself and maintainers ( yourself / others ) ? Is it possible for this to begin to be the recommended way to support IOS for OpenSTF?

koral-- commented 4 years ago

Sorry for lack of any response. As you can see recently a lot of PRs were merged in STF repos after few months of inactivity. I need to first sort out the release of version supporting Android 10 and will get back to topic of iOS ASAP.

nanoscopic commented 4 years ago

@koral-- That makes sense. We ourselves encountered the Android 10 issue and are in progress of utilizing the new work. Thanks for all the hard work in that regard and agreeably that is crucial right now.

Thanks for the update. No rush on getting to IOS; was simply curious what is going on.

denis99999 commented 4 years ago

@nanoscopic , @jupe, I pursue #1162 discussion here because it concerns IOS support in STF.

I think there is a misunderstanding on what a device provider is made for in STF. Of course, I can be wrong but in my mind, the role of a device provider in STF is to give the remote control in a secure way to the devices it manages, that's all, and not to be directly concerned by specific application requirements as Appium one wether for Android or IOS.

For instance, the Android provider has mainly to be able to:

So, concerning IOS provider, there is only need to develop special code to interface correctly with STF and client applications, and libimobiledevice seems to me sufficient to implement required basic access functions to IOS devices. For instance, the HP solution named HP Mobile Center may have their IOS providers as Linux machines including the libimobiledevice, and their central server interact with them through their proprietary protocol, it works without jailbreaked devices, I tested it as a trial two years ago.

I talk about USB/IP to enable remote access to the devices controlled by the IOS provider from the client MacOS machine in which would run Appium or any other tools, it is a way of making the remote devices locally attached on the client machine. Obviously, that requires ideally a special development at both client & provider sides.

Such architecture separating device logic from application logic by the network layer (e.g. using USB/IP), as it is made in Android using ADB interface, has some main benefits:

Did you also evaluate the impact of IOS integration on the rest of STF code which is pretty Android oriented (i.e. sceens, API, ...) in order to keep a full featured solution ?

In any case, your proposal is very interesting so congratulation for this great work!

rafcasto commented 4 years ago

First of all thank you so much for your dedication and work on this project, i hope to contribute in the near feature,

I am having some issues connecting IOS devices, it always displays as disconnected, do you have any idea what am I doing wrong?

Note, it seems the wda is not being installed in the device

regards Rafael

rafcasto commented 4 years ago

hi Got it working,

I realised in order to build the wdaproxy i needed to set the following env variables: export GOPATH=~/go export GOBIN=$GOPATH/bin

then ideviceinfo was not working properly in my system so i had to reinstalled

536 brew uninstall --ignore-dependencies libimobiledevice 537 brew uninstall --ignore-dependencies ideviceinstaller 538 brew uninstall --ignore-dependencies usbmuxd 539 sudo rm /var/db/lockdown/* 540 brew install --HEAD usbmuxd 541 brew unlink usbmuxd 542 brew link usbmuxd 543 brew install --HEAD libimobiledevice 544 brew install --HEAD ideviceinstaller

hope this help someone else

nanoscopic commented 4 years ago

@rafcasto As shown; idevice* can get messed up and require the uninstall / reinstall. This is done automatically though be ./init.sh in stf_ios_support repo. I haven't ever seen a need to set the path to go in order to get things working; but glad that you found a fix that works for you and shared it.

At some point the dependency on idevice is going to be dropped; because it is ridiculous that the stable version doesn't function and the head version must be installed. There is a partially complete golang port of idevice, that will be possible to use once the issues with it are ironed out.

@denis99999 The term "stf provider" refers to a very specific thing in relation to the OpenSTF project. It refers to the stf provider unit in the NodeJS project. This: https://github.com/openstf/stf/tree/master/lib/units/provider

The term "device unit" refers to another very specific thing. This: https://github.com/openstf/stf/tree/master/lib/units/device

There is no such thing as a "device provider" as it conflates these two things.

The thing you are thinking of when you say "android device provider" is not one thing but a collection of things. The primary bit is the "device provider", which in turn uses idevice* and WDA in order to work. WDA in turn uses Xcode and XCUitest to automate the IOS device. Bits of WDA are installed as an app on the device, but most of the functionality you think of, such as clicking, swiping, etc is done by XCUitest, not by the app on the device. XCUitest is a closed source portion of Xcode that uses propietary lockdown protocol to communicate over USB to the IOS device.

USB/ip doesn't help as I've stated already, and your post is simply wishful thinking.

I've already done significant research into the long term path for supporting IOS support in OpenSTF more cheaply and without the dependency on Mac OS. It requires reverse engineering lockdown protocol. That can and will be done but it's labor intensive, and is not something actively being worked on right now.

The other option is having Apple themselves provide information on how how to use lockdown protocol directly to initiate touch actions on the device. Word on the grapevine is that they've done this for the closed source projects providing IOS devices. Sadly this information has not been shared publicly. ( presumably because the closed sourced projects paid Apple for the information and agreed not to tell anyone how )

rafcasto commented 4 years ago

@nanoscopic thanks for your reply, i am experimenting with VNC and i have couple of questions,

  1. what is the role of openvpn server, i was able to use veency without openvpn.
  2. after using VNC flag as true I am getting the following error in the stf_provider Starting inspector on 127.0.0.1:9230 failed: address already in use any Idea how can i solve this issue?
danielpaulus commented 4 years ago

Heyo, btw I have decided to open source the DTX messaging framework, which is responsible for launching and killing apps, running xcuitests and getting cpu and memory stats from devices. Here is a tool to dump raw XCUITests DTX messages: https://github.com/danielpaulus/ios_simulator_dtx_dump and here is the codec library: https://github.com/danielpaulus/dtx_codec Eventually I'll add it to https://github.com/danielpaulus/go-ios so you can do all the things stated above

nanoscopic commented 4 years ago

@rafcasto The purpose of using openvpn is so that "stf server" can be run in the cloud / in a different network than the providers themselves. The providers then VPN in so that they are on the same network and can connect and work with "stf server".

The "inspector" is a piece of the WDA. If you get this error it generally means that the WDA is already running somehow/way. Just based on that I have no way to know why you are getting that error.

The following information would be needed to attempt it:

  1. What code are you using ( repos and commits )
  2. How did you setup those repos ( what steps did you follow )
  3. If you are using stf_ios_support; what is your config.json
  4. Since you mention VNC; have you jailbroken your IOS device and installed and enabled Veency?
  5. If using stf_ios_support; do you see any other error messages and/or have you looked at the ./view_log -proc [various subprocesses] logs?
  6. Does everything work properly without enabling the VNC flag?

Considering your message is now nearly 2 months old, I would also suggest simply checking out and using the latest stf_ios_support. You will likely have a much better experience now after the many updates.

gkrananth commented 4 years ago

i am able to run docker stf server as given instruction but dont know how to access the dashboard ? whats the url?

https://github.com/tmobile/stf_ios_support

nanoscopic commented 4 years ago

@gkrananth The server/docker-compose within stf_ios_support repo makes STF server interface available on https port 443 if used as-is. You can either setup a domain name to point to the IP of your machine running the docker-compose, or you can use it directly by IP address.

See https://github.com/tmobile/stf_ios_support/blob/master/server/cert/server.conf The default pre-generated cert for https that is provided is using the hardcoded IP address of 192.168.56.108 ; that is a default IP address for NAT of Virtualbox. If you were running a Linux VM on Virtualbox; that IP address could be used to access STF. You'll see there also the default cert domain is stf.test ( .test being a private TLD used for testing ) You can setup within your own DNS or /etc/hosts that domain pointed to the IP address of your machine. ( or update the server.conf file with your IP, rerun gencert.sh ; and restart everything )

Your options:

  1. Access by IP 1A. Pick an IP address your machine running docker-compose uses: such as 192.168.1.2 ( if it had that IP ) 1B. Update server.conf with that IP address 1C. Rerun gencert.sh 1D. Restart everything 1E. Go to https://192.168.1.2

  2. Access by DNS setup via /etc/hosts 2A. Figure out your IP address ( 192.168.1.2 as example ) 2B. Add an /etc/hosts entry 192.168.1.2 stf.test 2C. Restart your browser 2D. Go to http://stf.test

  3. Access by real public DNS 3A. Setup a hostname on public DNS pointing to your machine running docker-compose ( somedomain.com ) 3B. Use LetsEncrypt to generate an https cert for your domain 3C. Add your cert files you made via LetsEncrypt in place of the provided self-signed certs made with gencert.sh

gkrananth commented 4 years ago

Hi Thanks i dont wanted to use https, so i removed the https part in docker compose and as well as wss to ws. Now my problem is how do i access the stf from outside network. Locally its working fine, but am getting error websocket timeout on video streaming. How do achieve the access the stf dashboard from other pc.

koral-- commented 4 years ago

This project is superseded by https://github.com/DeviceFarmer/stf. Please continue discussion at https://github.com/DeviceFarmer/stf/issues/35.