status-react/nix/mobile/ios/default.nix
Siddarth Kumar 5a7bfc61cc
fix: make run-ios-device script (#18845)
fixes #16310

We used to reply on `react-native cli` and would pass a `--device` flag to deploy the debug variant of `iOS` app on connected `iPhone`.
`react-native cli` under the hood uses `ios-deploy` library to achieve this functionality.
This showed many weird issues, specifically in locating connected devices and failures at build step with ambiguous error messages.

This commit fixes it by using our custom script `run-ios-devices.sh` which does not rely on `ios-deploy`.
We use `libimobiledevice` to identify `UDID` of a connected `iPhone`.
We use `xcrun devicectl device install app` and `xcrun devicectl device process launch` to install and launch the app.

This works well with `Xcode 15` and `iOS 17.x`.
We can now remove `ios-deploy` from `iOS` shell and `nix` overlay.
We also set up a logs folder and add a Readme.

## Review notes

- connect your iPhone to your Laptop via a cable
- `make run-clojure`
- `make run-ios-device`
(note: no need to pass device name now)

## Platforms
- iOS
2024-02-20 10:54:09 +05:30

38 lines
1.0 KiB
Nix

{ callPackage, lib, mkShell, pkgs, stdenv
, status-go, fastlane }:
assert lib.assertMsg stdenv.isDarwin
"iOS development shell supported only on OSX.";
let
inherit (lib) catAttrs unique;
# Sub-shells preparing various dependencies.
nodejs-sh = callPackage ./shells/nodejs.nix { };
bundler-sh = callPackage ./shells/bundler.nix { };
cocoapods-sh = callPackage ./shells/cocoapods.nix { };
status-go-sh = callPackage ./shells/status-go.nix { inherit status-go; };
in {
inherit nodejs-sh cocoapods-sh status-go-sh;
shell = mkShell {
buildInputs = with pkgs; [
xcodeWrapper watchman procps
flock # used in nix/scripts/node_modules.sh
xcbeautify # used in 'make run-ios'
libimobiledevice # used in `make run-ios-device`
];
# WARNING: Executes shellHook in reverse order.
# WARNING: Only some variables are merged.
inputsFrom = [
fastlane.shell
cocoapods-sh
nodejs-sh # before 'pod install'
bundler-sh # before 'pod install'
status-go-sh # before 'pod install'
];
};
}