- Install VSCode
- Install Bazelisk
- Install extension llvm-vs-code-extensions.vscode-clangd
- Install extension bazelbuild.vscode-bazel
- Install extension xaver.clang-format
- Configure clang-format path in User Settings
- Install extension vadimcn.vscode-lldb
- Run Build Task
- Launch DebugTestAppMacOS from VSCode
- Download Tulsi from GitHub at head
- As of writing, Tulsi did not build with Bazel 5.0.0 (current release), so I used Bazelisk and created a
.bazelversion
file in the repo containing6.0.0-pre.20220112.2
. - As of writing, Tulsi hardcoded to Xcode 13.0, so I opened
build_and_run.sh
and modified this line toxcode_version="13.2"
. - Execute
./build_and_run.sh
- Open
test_app/test_app.tulsiproj
- Generate the iOS or tvOS config
- Run the test_app target on a simulator
I won't go into the nitty gritty because stuff changes all the time, but the gist is:
- On the Apple Developer site, create an Identifier. Usually the XC Wildcard (*) for all apps run for the team is the easiest for development. For production, consider tighter scoping.
- Create a certificate for Apple Development which covers all platforms. Add the downloaded certificate into your login keychain via the Keychain Access app.
- Register your devices with unambiguous names. For iOS/tvOS, grab the UUID by connecting the device to your computer and opening 'Devices & Simulators' within Xcode. The 'Identifier' is the UUID. For macOS, go to System Report, the UUID is the 'Provisioning ID'.
- Create a Provisioning Profile, one development profile per platform, selecting the above identifier, certificate, and devices. Download it and save it to somewhere in the source tree (it is not a secret, as to use it, someone would need a copy of your certificate in their keychain).
- Refer to it in a
(macos|ios|tvos)_application
rule via theprovisioning_profile
attribute.
Replace profiles/ios.mobileprovision
with your own. Mine was scoped to (IDs and names scrubbed):
- App ID: Team Wildcard: XYZ123ABCD.*
- Devices: Nick's iPhone
- Platform: iOS
- Certificate: Apple Development (expires 2023/01/01)
- In Xcode go to TestApp > Targets > test_app(ios|tvos) > Signing & Capabilities
- Select your team
- Ensure 'Automatically manage signing' is unchecked
- Select Provisioning Profile' 'Apple iOS Development (*)'
- Run on a device contained in the profile
One issue I got was that Bazel failed to run on device with the following error:
unable to find an identity on the system matching the ones in provisioning profile
The issue was that (and you can see this in Keychain Access) my development certificate was "not trusted". This was because Apple's WWDC certificate had expired and needed to be updated (rare): https://developer.apple.com/support/expiration/ https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
- Run
bazel run :refresh_compile_commands
in a terminal, which refreshes what exactly is getting built.
My Mac: GL Renderer: Intel(R) HD Graphics 6000 GL Version: 4.1 INTEL-18.3.5 iOS Sim: GL Renderer: Apple Software Renderer GL Version: OpenGL ES 3.0 APPLE-19.0.17