We provide an open-source library for iOS and OSX that works with some fairly low-level APIs. Its therefore important to test across a range of devices, especially iOS 32 vs 64 bit.
In the past, this has been done manually which was not perfect. One or two bugs slipped through the cracks and were instead reported by users. That is, a feature that worked on 32bit devices would fail on 64bit devices. Now that Xcode allows on-device testing, I think we can do better.
Currently we have a build script that runs tests for OSX and the iOS simulator. It serves two purposes:
- Can be run before committing or sending pull requests.
- Is run by the build server after each commit.
I'd like to use cmd-line utils to read the list of plugged-in devices. And then:
- Have a 32bit and 64bit device plugged into the build server, which will test against this list of devices.
- Not have any hard-coded device IDs so the script will still work unmodified and from a clean checkout on local workstations.
How can I use cmd-line utils to read the list of plugged in devices?
- Preferably without installing any dependencies.
- Or if dependencies are required, ones that can be installed from a package manager like HomeBrew or MacPorts.