- Built using: XCode 14.3.1 on MacOS Ventura 13.5
-
Install XCode
-
Add your developer Apple ID to XCode
- XCode -> XCode menu -> Preferences -> Accounts Tab
- Click
+
underApple IDs
list - Choose
Apple ID
- Login to your account
-
Download a "Apple Development certificate" for your user
- Continue from previous step, right after logging into your Developer account in Xcode
- Select
Manage Certificates
- Click
+
in the lower left corner - Select
Apple Development
-
Install Homebrew
-
Install Python 2.7 from MacPorts
- Install MacPorts
- In terminal:
ports install python27
- Add in NGINX config (in STF server deployment) block configuration for new provider:
- Client IP should be changed from
[^/]
to some more specific range such as:(?<client_ip>192.168.255.[0-9]+)
to restrict it to a reasonable IP range - If left alone this example config will let clients arbitrarily tunnel to any IP on ports
8000-8009
# MacOS
location ~ "^/frames/(?<client_ip>[^/]+)/(?<client_port>800[0-9])/x$" {
proxy_pass http://$client_ip:$client_port/echo/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
}
-
Register(provision) your IOS device to your developer account as a developer device.
-
Use the API -or-
- Follow https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api to create an app store connect API key. Give it Developer access.
- Gain a session using JSON Web Tokens
- Create a provisioning profile if none exist using profiles: https://developer.apple.com/documentation/appstoreconnectapi/profiles See also https://github.com/cidertool/asc-go/blob/f08b8151f7fd92ff54924480338dafbf8a383255/asc/provisioning_profiles.go
- Post to the devices endpoint to register a device: https://developer.apple.com/documentation/appstoreconnectapi/devices See also https://github.com/cidertool/asc-go/blob/f08b8151f7fd92ff54924480338dafbf8a383255/asc/provisioning_devices.go
-
Follow these instructions: https://www.telerik.com/blogs/how-to-add-ios-devices-to-your-developer-profile I couldn't find updated instructions on Apple's website. If you find them please let me know so I can link to them.
-
-
Plug in your IOS device to PC
-
Accept pairing on IOS device screen
-
Access device on PC:
- Open
Finder
- Click to device
- Accept pairing to device
- Open
-
Have Xcode setup the "developer image" on your IOS device:
- Open Xcode
- Go to Windows... Devices and Simulators
- Wait while Developer Image is installed to your phone
-
Download actual profiles for device by Xcode or TestFlight: https://docs.fastlane.tools/actions/sigh/
- Run
./init.sh
- View error:
mobiledevice => version 2.0.0
libplist - Installing HEAD
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
You have 32 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.
Cloning into '/Users/emb/Library/Caches/Homebrew/libplist--git'...
Already on 'master'
/usr/local/lib/pkgconfig/libplist.pc was missing; creating symlink to /usr/local/Cellar/libplist/HEAD-c3af449/lib/pkgconfig//libplist-2.0.pc
ln: /usr/local/lib/pkgconfig/libplist.pc: File exists
libusbmuxd - Installing HEAD
Already on 'master'
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels.
Could not fix pkgconfig for libusbmuxd; could not locate installed pc file in Cellar
- Need manual install needed libs, run:
brew install --HEAD libusbmuxd
- And view new error:
==> Cloning https://github.com/libimobiledevice/libusbmuxd.git
Cloning into '/Users/emb/Library/Caches/Homebrew/libusbmuxd--git'...
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> ./autogen.sh
Last 15 lines from /Users/emb/Library/Logs/Homebrew/libusbmuxd/01.autogen.sh:
checking whether to build static libraries... yes
checking for pkg-config... /usr/local/Homebrew/Library/Homebrew/shims/mac/super/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libplist-2.0 >= 2.2.0... yes
checking for libimobiledevice-glue-1.0 >= 1.0.0... no
configure: error: Package requirements (libimobiledevice-glue-1.0 >= 1.0.0) were not met:
No package 'libimobiledevice-glue-1.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables limd_glue_CFLAGS
and limd_glue_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Do not report this issue to Homebrew/brew or Homebrew/core!
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels.
This error initial by new dependenses: https://github.com/libimobiledevice/libimobiledevice-glue
-
Resolve:
brew create --set-name libimobiledevice-glue-1.0 "https://github.com/libimobiledevice/libimobiledevice-glue.git"
- Save file without changes
- Edit file:
brew edit libimobiledevice-glue-1.0
It text needed:
class LibimobiledeviceGlue10 < Formula desc "" homepage "" url "https://github.com/libimobiledevice/libimobiledevice-glue.git" head "https://github.com/libimobiledevice/libimobiledevice-glue.git" version "1.0.0" sha256 "" license "" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "libplist" def install system "./autogen.sh" system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "install" end test do system "false" end end
- Install library:
HOMEBREW_NO_INSTALL_FROM_API=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install --HEAD libimobiledevice-glue-1.0
- Manual fix symlinks:
./util/brewser.pl fixpc libimobiledevice-glue-1.0 1.0.0 cd /usr/local/lib/pkgconfig/ rm libimobiledevice-glue-1.0.pc libimobiledevice-glue-1.0-1.0.0.pc ln -s ../../Cellar/libimobiledevice-glue-1.0/HEAD-<HASH>/lib/pkgconfig/libimobiledevice-glue-1.0.pc libimobiledevice-glue-1.0.pc ln -s ../../Cellar/libimobiledevice-glue-1.0/HEAD-<HASH>/lib/pkgconfig/libimobiledevice-glue-1.0.pc libimobiledevice-glue-1.0-1.0.0.pc ls -al libimobiledevice-glue-1.0*
- Fix env:
export PKG_CONFIG_PATH=$(find /usr/local/Cellar -name 'pkgconfig' -type d | grep lib/pkgconfig | tr '\n' ':' | sed s/.$//)
- Fix formulae:
brew edit libusbmuxd
- Add in file new dependens:
depends_on "libimobiledevice-glue-1.0"
- Save file
- Install libs:
HOMEBREW_NO_INSTALL_FROM_API=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install --HEAD libusbmuxd HOMEBREW_NO_INSTALL_FROM_API=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install --HEAD libimobiledevice ./util/brewser.pl fixpc libusbmuxd 2.0 ./util/brewser.pl fixpc libimobiledevice 1.0
-
Clone the various needed repos
- Run
make clone
- Run
-
Configure WebDriverAgent to use your identity for signing
- Open
repos/WebDriverAgent/WebDriverAgent.xcodeproj
in XCode - Select the WebDriverAgentLib target
- Go to the
Signing & Capabilities
tab - Select your team under
Team
- Change Bundle Identifier to your
- Repeate this action for WebDriverAgentRunner, UnitTests, IntegrationTests_[1:3] and IntegrationApps
- Select in top target for builder: WebDriverAgentRunner
- Select in top physical device for builder
- Test build and run test: select in XCode menu
Product
andTest
- In log chech what start server and success
- Close XCode
- Open
-
Create config:
- Copy the first {} block from
config.json.example
intoconfig.json
. Do not include any comment lines starting with // - Edit config.json
- Update
xcode_dev_team_id
to be the OU of your developer account. If you add your account into Xcode first, you can then runmake ou
to display what the OU is. You can also find it by opening the keychain, selecting the Apple Development certificate for your account, and then looking at what theOrganization Unit
is. - Update
root_path
to be where provider code should be installed, such as/Users/user/stf
- Update
config_path
to match that, such as/Users/user/stf/config.json
- Set
use_vnc
tofalse
(https://githubhelp.com/devicefarmer/stf_ios_support/issues/37)
- Update
- Sample:
{ "xcode_dev_team_id": "XXXXXXXXX", "stf": { "ip": "192.168.1.10", "hostname": "stf.example.com" }, "video": { "enabled": true, "use_vnc": false, "vnc_scale": 2, "vnc_password": "", "frame_rate": 10 }, "install": { "root_path": "/Users/user/stf", "config_path": "/Users/user/stf/config.json", "set_working_dir": false }, "bin_paths": { "video_enabler": "bin/video_enabler" } }
- Copy the first {} block from
- Fix env before build:
export PKG_CONFIG_PATH=$(find /usr/local/Cellar -name 'pkgconfig' -type d | grep lib/pkgconfig | tr '\n' ':' | sed s/.$//)
- Fix error repos
wdaproxy
:
cd repos/wdaproxy
go get github.com/DHowett/[email protected]
go install github.com/DHowett/[email protected]
go mod tidy
-
Build:
make
-
Run then
- dist.tgz will be created
- Copy
dist.tgz
from build machine - Run
tar -xf dist.tgz
- Tweak
config.json
as desired
-
Check plugging devices:
idevice_id
-
Pair its with your system
- Run
idevicepair pair
- Accept pairing on IOS device screen
- Run
-
Activate video by devices
- Activate screen devices
- Run QuickTime Player in GUI Mac
File
-->New video
- Choice device
- Check what video work
- Exit QuickTime Player
- Check what video activate on all physical devices:
./bin/ivf_pull list
-
Run
./bin/ios_video_pull -devices -decimal
to determine the PID ( product ID ) of your IOS device in decimal -
Run
./bin/devreset [decimal product ID] 1452
to reset the video streaming status of your IOS device -
Activate screen on all physical devices and run
./run
( and leave it running ) -
Permissions dialog boxes appear for coordinator to listen on various ports; select accept for all of them
-
Device shows up in STF with video and can be controlled.