Skip to content

Commit c79167a

Browse files
committed
Update README
1 parent 164763d commit c79167a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# rust-on-ios
1+
# Rust on iOS/macOS
22

3-
This project is a resource for developers who want to build iOS apps that make use of Rust libraries.
3+
This project is a resource for developers who want to build iOS or macOS apps that make use of Rust libraries.
44

5-
The `ios-test-harness` Xcode project in this repo provides an iOS-based test framework that can be used similar to the standard Rust test framework. It expects the crate being tested to provide a static library with a single `extern C` entrypoint with the signature `void test()`. When run in the simulator (or on an iOS device), the test harness puts up a single screen with a `Run Test` button that can be used to invoke the `test()` entry. When run via the Xcode `Project>Test` menu, the test harness invokes the `test()` entry as part of the test sequence.
5+
The `rust-test-harness` Xcode project in this repo provides an XCode-based application that can be used to invoke a Rust-built static library. It expects the crate being tested to provide a static library with a single `extern C` entrypoint with the signature `void test(int op)` (on the Rust side, that’s `extern "C" fn test(op i32)` with name mangling turned off). When the iOS build target is run in the simulator (or on an iOS device), or whenb the macOS build target is run on a Mac, the test harness puts up a screen with a picker for which test you want to run, and then it passes the index of that choice as the argument to the `test` entry.
66

7-
The idea is to have your `test()` entry run the same series of tests that you would run via the Rust test harness. If the tests pass without panic, the run is successful.
7+
If the test runs without panicing, you get an alert on the iOS side that says to check the logs for details. Anything you print to stdout on the Rust side will be in the log.
88

99
The test harness can be used on your own crates simply by cloning it locally and creating an appropriate `test-spec.sh` file at the top level of the project which declares where your crate is and how to build the test library. You can copy the `test-spec.sample.sh` file to `test-spec.sh` in order to get started. Detailed instructions are in the next section.
1010

11+
**PLEASE NOTE**: You will need your own Apple developer account in order to build and run this project, because both the iOS and macOS targets use provisioning profiles. You will have to change those provisioning profiles to ones that you own.
12+
1113
## Usage
1214

1315
Because Apple remembers which developers have registered which bundle ids, to use this test harness you will have to go into XCode and change its bundle ID and signing information. When you open the test harness project, XCode may recommend that you update your script sandbox settings…don’t! This will prevent the test harness from accessing your crate directory.
@@ -24,9 +26,9 @@ If both `CRATE_PACKAGE` and `CRATE_EXAMPLE` are specified, the build will specif
2426

2527
This test harness can be used to test both debug and release builds of your crate. Running the test harness in the Debug configuration will do a debug build of your library, and similarly for Release.
2628

27-
The XCode target of your build (e.g., an ios device or an ios simulator) will be used to pick an appropriate target platform for your rust library build. You must have installed the appropriate target support on your machine.
29+
The XCode target of your build (e.g., a macOS device, an iOS device or an iOS device simulator) will be used to pick an appropriate target platform for your rust library build. You must have installed the appropriate target support on your machine.
2830

29-
NOTE: This test harness assumes you have done a standard install of Rust using `rustup` and sets the `PATH` variable based on that when building your test library.
31+
(N.B. This test harness assumes you have done a standard install of Rust using `rustup` and sets the `PATH` variable based on that when building your test library.)
3032

3133
For example: The `test-spec.sample.sh` file that comes with this project assumes that the directory containing the `ios-test-harness.xcodeproj` bundle (that is, the top level of this repository) is adjacent to the directory containing the crate being tested (called `keyring-rs`), and that the test library is an example in that crate.
3234

@@ -41,6 +43,4 @@ at your option.
4143

4244
## Contribution
4345

44-
Unless you explicitly state otherwise, any contribution intentionally submitted
45-
for inclusion in the work by you shall be dual licensed as above, without any
46-
additional terms or conditions.
46+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

0 commit comments

Comments
 (0)