Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
03831a9
set python version to PY2
woshimaliang Nov 26, 2019
2f88d59
Merge pull request #10 from woshimaliang/force_python2
albertdai Dec 17, 2019
f6ebebe
Fix test failures with Xcode 11 on pre-iOS 12.2 devices running Swift…
Dec 29, 2019
091f9c0
Docs.
Jan 1, 2020
d777096
Merge pull request #13 from jverkoey/fixswift1
albertdai Jan 2, 2020
d2b9ed9
Refactor the code structure
albertdai Feb 10, 2020
aa821f3
Update test runner with internal change
albertdai Feb 10, 2020
3776f41
Update test runner with internal change
albertdai May 1, 2020
4018845
Remove python_version attribute
albertdai May 27, 2020
41b18a2
Fix python2 interpreter
keith Jun 22, 2020
f52307f
Merge pull request #20 from keith/ks/custom-interpreter
albertdai Jun 23, 2020
67100a8
Pass DEVELOPER_DIR to `xcrun simctl spawn`
brentleyjones Jun 30, 2020
964120c
Add xcresult bundle collection
keith Jul 15, 2020
74f270e
Ignore non diagnosticsRef ids
keith Jul 16, 2020
961bd04
Merge pull request #24 from keith/ks/ignore-non-diagnosticsref-ids
albertdai Aug 4, 2020
75cb0e3
Merge pull request #21 from brentleyjones/properly-pass-developer-dir
albertdai Aug 4, 2020
269e9f8
output_dir
keith Aug 4, 2020
3aeb419
add option
keith Aug 4, 2020
cefec9d
docs
keith Aug 4, 2020
0809aad
Merge pull request #22 from keith/ks/add-xcresult-bundle-collection
albertdai Aug 4, 2020
81bf468
Xcode 12.0 compatible change on device testing.
albertdai Aug 4, 2020
a9dd528
Expose crash reports from xcresult bundle
albertdai Aug 4, 2020
9f4e1ce
Allow running the test runner binary target from another repository
segiddins Sep 5, 2020
e012c92
Python 3 Support
segiddins Sep 9, 2020
659a147
Add a :// for_bazel_tests target for rules_apple integration tests
segiddins Sep 9, 2020
64a9be0
Merge pull request #27 from segiddins/segiddins/allow-running-ios-tes…
albertdai Dec 17, 2020
6a86a20
Fix compatibility with Python 3.9
thii Apr 28, 2021
6a3b6f9
Add missing arg docs
thii May 5, 2021
33bb701
Remove glob that doesn't match any files.
Apr 19, 2021
5a1b0c1
Merge pull request #29 from thii/fix-compatibility-with-python-3.9
albertdai May 26, 2021
88ff340
Fix: selected tests are not picked up
trinhngocthuyen Jun 1, 2021
2451025
Fix typos
bogo Oct 9, 2021
708ace6
Skip results with missing activitySummaries field.
bogo Oct 9, 2021
aa22834
Merge pull request #36 from bogo/fix-activitySummaries-crash
albertdai Oct 28, 2021
f821510
Merge pull request #32 from jschear/js/remove_empty_globs
albertdai Oct 28, 2021
7f8fc81
Incremental changes for test runner
albertdai Oct 28, 2021
a13ec9d
Add DEVELOPER_DIR env back to execute logic test
albertdai Nov 1, 2021
24ba151
Merge pull request #33 from trinhngocthuyen/fix/selected_tests
albertdai Nov 2, 2021
a171066
Stop including stderr in simulator output
keith Jan 27, 2022
db0fce1
Merge pull request #41 from keith/ks/stop-including-stderr-in-simulat…
albertdai Feb 3, 2022
b7585ca
Fix ProductModuleName with dashes
keith Feb 4, 2022
e0bc4b2
Merge pull request #42 from keith/ks/fix-productmodulename-with-dashes
albertdai Mar 18, 2022
b8788ca
xcode13: copy private frameworks for xcuitest tests
elpancho60 Mar 21, 2022
13e9f8f
Remove use of subpar
keith Nov 28, 2022
5bb42a5
Add initial MODULE.bazel
keith Jan 12, 2023
6add1cf
Merge pull request #51 from keith/ks/add-initial-module.bazel
tirodkar Jan 12, 2023
c9eac28
Merge pull request #48 from keith/ks/remove-use-of-subpar
tirodkar Jan 12, 2023
7c38654
Merge pull request #44 from elpancho60/fescobedo/xcuitest-xcode-13-co…
me11kiy Jan 13, 2023
ade9c43
Fix startup json var spelling
keith Jan 19, 2023
00e9f13
Merge pull request #53 from keith/ks/fix-startup-json-var-spelling
tirodkar Jan 19, 2023
85a5d31
Do not rely on repository imports
fmeum Nov 9, 2022
6b8e46c
Merge pull request #47 from fmeum/master
me11kiy Jan 20, 2023
de26ac9
Fix __init__.py generation causing wrong sys.path entry to be picked up
BalestraPatrick Feb 11, 2023
24629f3
Update __init__.py
BalestraPatrick Feb 11, 2023
a7e336b
[Xcode 14] Don't collect diagnostics
jerrymarino Feb 10, 2023
e508685
Update xctestrun.py with XCTestSupport.framework that has issues with…
tirodkar May 13, 2023
4c5709d
Fix -collect-test-diagnostics arg for Xcode 14.1 / 14.2
keith May 17, 2023
b7698df
Create .xctestrun file instead of .plist
aircraft-cerier Aug 16, 2023
ad26f06
Update path to DeviceTypes for Xcode 16.3
araifura-sc Apr 14, 2025
429e167
Fix xcresulttool for Xcode 16
Jan 6, 2025
8710f14
Merge pull request #67 from thelvis4/fix-devicetype-path-xcode-16.3
me11kiy May 27, 2025
5f53db6
fix xctestrunner test runner for Xcode 16.3 and above
DoDoENT Jul 22, 2025
a33ff27
Retry `xcodebuild` by rebooting simulator when stuck
jpsim Sep 30, 2025
6749b2d
Add explicit load for python rules
keith Oct 30, 2025
f2403b1
Merge pull request #76 from keith/ks/add-explicit-load-for-python-rules
me11kiy Nov 17, 2025
d2ed8ce
Merge pull request #71 from DoDoENT/master
me11kiy Nov 17, 2025
4c6f493
Merge pull request #75 from jpsim/retry-xcodebuild-by-rebooting-simul…
me11kiy Feb 12, 2026
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
45 changes: 29 additions & 16 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
package(default_visibility = ["//visibility:public"])
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

load("@subpar//:subpar.bzl", "par_binary")
package(default_visibility = ["//visibility:public"])

py_library(
name = 'shared',
srcs = glob(['shared/*.py']),
name = "shared",
srcs = glob(["xctestrunner/shared/*.py"]),
)

py_library(
name = 'simulator',
srcs = glob(['simulator_control/*.py']),
name = "simulator",
srcs = glob(["xctestrunner/simulator_control/*.py"]),
deps = [
':shared',
":shared",
],
)

par_binary(
name = 'ios_test_runner',
srcs = glob(
['test_runner/*.py'],
exclude = ['test_runner/TestProject/**']
py_binary(
name = "ios_test_runner",
srcs = [
"__init__.py",
"xctestrunner/__init__.py",
] + glob(
["xctestrunner/test_runner/*.py"],
),
main = 'test_runner/ios_test_runner.py',
main = "xctestrunner/test_runner/ios_test_runner.py",
python_version = "PY3",
deps = [
':shared',
':simulator',
":shared",
":simulator",
],
data = glob(['test_runner/TestProject/**']),
)

# Consumed by bazel tests.
filegroup(
name = "for_bazel_tests",
testonly = 1,
srcs = glob(["**/*"]),
# Exposed publicly just so other rules can use this if they set up
# integration tests that need to copy all the support files into
# a temporary workspace for the tests.
visibility = ["//visibility:public"],
)
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module(
name = "xctestrunner",
version = "0.2.15",
compatibility_level = 1,
)

bazel_dep(name = "rules_python", version = "1.0.0")
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ A tool for running prebuilt iOS tests on iOS real device and simulator.

## Features
- It supports XCTest (Xcode Unit Test), XCUITest (Xcode UI Test).
- It supports iOS 7+ iOS real device, iOS simulator.
- It supports iOS 11+ iOS real device, iOS simulator.
- It supports launch options configuration: test methods to run, additional
environment variables, additional arguments.
- It supports Xcode 7+.
- It supports Xcode 10+.

## Prerequisites
- Install Xcode (Xcode 7+). XCUITest support requires Xcode 8+.
- Install Xcode (Xcode 10+).
- [Install bazel](https://docs.bazel.build/install.html) (optional).
- py module [biplist](https://github.com/wooster/biplist).

## Installation
You can download the ios_test_runner.par binary in [release](https://github.com/google/xctestrunner/releases)

or build the ios_test_runner.par binary by bazel:
```
$ git clone https://github.com/google/xctestrunner.git
$ cd xctestrunner
$ bazel build :ios_test_runner.par
$ ls bazel-bin/ios_test_runner.par
```

## Usage
- Build your app under test and test bundle. You can use Xcode.app,
`xcodebuild` command line tool or [bazel](https://github.com/bazelbuild/bazel).
Expand All @@ -35,12 +42,3 @@ Disclaimer: This is not an official Google product.

XCTestRunner uses Apple native tool `xcodebuild`, `simctl` to control iOS
Simulator and launch tests on iOS devices.

For testing, XCTestRunner injects app under test and test bundle file into a
dummy project. Then the dummy project can be used `xcodebuild test` to run
XCTest (not for XCUITest), or `xcodebuild build-for-testing` to generate
xctestrun file for further testing.

For iOS 7 real device testing, the latest supported Xcode version is 7.2.1.
For iOS 7 simulator testing, latest supported Xcode version is 7.2.1 and latest
supported MacOS version is Yosemite (10.10.x).
9 changes: 1 addition & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# For packaging python scripts.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "subpar",
remote = "https://github.com/google/subpar",
tag = "2.0.0",
)
workspace(name = "xctestrunner")
7 changes: 7 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file is just here to work around Bazel auto-generating an empty file here.
# What happens is `import xctestrunner` loads this file instead of the
# subdirectory because the root runfiles directory comes before the subdirectory
# on sys.path
import sys
from . import xctestrunner
sys.modules['xctestrunner'] = xctestrunner
Empty file removed simulator_control/__init__.py
Empty file.
Loading