Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make run-ios-device script #18845

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

siddarthkay
Copy link
Contributor

@siddarthkay siddarthkay commented Feb 15, 2024

fixes #16310

Summary

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 PR 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.

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)

Screen recording

run-ios-devices-1080p.mov

Platforms

  • iOS

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Feb 15, 2024

Jenkins Builds

Click to see older builds (20)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 801d142 #1 2024-02-15 15:53:47 ~5 min tests 📄log
✔️ 801d142 #1 2024-02-15 15:55:07 ~6 min ios 📱ipa 📲
✔️ 801d142 #1 2024-02-15 15:55:21 ~7 min android-e2e 🤖apk 📲
✔️ 801d142 #1 2024-02-15 15:55:31 ~7 min android 🤖apk 📲
✔️ 4660c75 #3 2024-02-16 05:07:45 ~4 min tests 📄log
4660c75 #3 2024-02-16 05:08:36 ~5 min ios 📄log
✔️ 4660c75 #3 2024-02-16 05:09:50 ~7 min android 🤖apk 📲
✔️ 4660c75 #3 2024-02-16 05:10:41 ~7 min android-e2e 🤖apk 📲
✔️ f9c4935 #4 2024-02-16 06:30:43 ~5 min tests 📄log
✔️ f9c4935 #4 2024-02-16 06:32:20 ~6 min ios 📱ipa 📲
✔️ f9c4935 #4 2024-02-16 06:32:44 ~7 min android 🤖apk 📲
✔️ f9c4935 #4 2024-02-16 06:33:09 ~7 min android-e2e 🤖apk 📲
✔️ 1d91919 #5 2024-02-17 06:27:45 ~6 min tests 📄log
✔️ 1d91919 #5 2024-02-17 06:28:44 ~6 min ios 📱ipa 📲
✔️ 1d91919 #5 2024-02-17 06:30:24 ~8 min android 🤖apk 📲
✔️ 1d91919 #5 2024-02-17 06:30:24 ~8 min android-e2e 🤖apk 📲
✔️ 0f0ff6f #7 2024-02-20 01:56:29 ~5 min tests 📄log
✔️ 0f0ff6f #7 2024-02-20 01:57:57 ~6 min android-e2e 🤖apk 📲
✔️ 0f0ff6f #7 2024-02-20 01:58:08 ~6 min android 🤖apk 📲
✔️ 0f0ff6f #7 2024-02-20 01:58:37 ~7 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c9632b8 #8 2024-02-20 02:28:22 ~5 min tests 📄log
✔️ c9632b8 #8 2024-02-20 02:29:37 ~7 min ios 📱ipa 📲
✔️ c9632b8 #8 2024-02-20 02:31:06 ~8 min android-e2e 🤖apk 📲
✔️ c9632b8 #8 2024-02-20 02:31:07 ~8 min android 🤖apk 📲
✔️ 43eaa57 #10 2024-02-20 05:17:35 ~4 min tests 📄log
✔️ 43eaa57 #10 2024-02-20 05:19:32 ~6 min ios 📱ipa 📲
✔️ 43eaa57 #10 2024-02-20 05:20:12 ~7 min android 🤖apk 📲
✔️ 43eaa57 #10 2024-02-20 05:20:17 ~7 min android-e2e 🤖apk 📲

Copy link
Member

@briansztamfater briansztamfater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@siddarthkay siddarthkay force-pushed the fix-make-ios-deploy-script branch from 4660c75 to f9c4935 Compare February 16, 2024 06:25
Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me 👍

Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, but the inverted approach seems better.

@siddarthkay
Copy link
Contributor Author

but the inverted approach seems better.

I'm also in favour of the inverted approach, I'll get to this PR in sometime and I still need to rebase this to that approach.

@siddarthkay siddarthkay force-pushed the fix-make-ios-deploy-script branch from 1d91919 to 6f82cb0 Compare February 20, 2024 01:50
@siddarthkay siddarthkay force-pushed the fix-make-ios-deploy-script branch 3 times, most recently from c9632b8 to b048973 Compare February 20, 2024 05:11
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

- connect your iPhone to your Laptop via a cable
- `make run-clojure`
- `make run-ios-device`
(note: no need to pass device name now)
@siddarthkay siddarthkay force-pushed the fix-make-ios-deploy-script branch from b048973 to 43eaa57 Compare February 20, 2024 05:12
@siddarthkay siddarthkay merged commit 5a7bfc6 into develop Feb 20, 2024
6 checks passed
@siddarthkay siddarthkay deleted the fix-make-ios-deploy-script branch February 20, 2024 05:24
ibrkhalil pushed a commit that referenced this pull request Feb 25, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

make run-ios-device DEVICE_NAME="YOUR DEVICE NAME" fails while building with error code 65
10 participants