beansoft / react-native-console

🧩 an IDEA/WebStorm/Android Studio Plugin for One-Click run React Native commands in embed terminal
BSD 3-Clause "New" or "Revised" License
184 stars 28 forks source link

Sorry, no physical iOS devices found! #73

Open efstathiosntonas opened 2 years ago

efstathiosntonas commented 2 years ago

Hi, I'm using version 2022.2.4 and when I try to run on a physical device connected with USB it throws: Sorry, no physical iOS devices found!

Webstorm version: 2022.2.2, Xcode version 13.4.

ps. when running via Xcode everything is fine, if I pick an emulator it runs fine (via rn console). Let me know if you need any further information.

efstathiosntonas commented 2 years ago

some error logs (line 5 & 6), I have no clue if they're related to the issue:


2022-09-05 17:22:22,666 [103092934]   INFO - STDERR - java.lang.reflect.InvocationTargetException
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at jdk.internal.reflect.GeneratedMethodAccessor1121.invoke(Unknown Source)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.github.beansoftapp.javascript.codeInsight.daemon.impl.JavaScriptUnusedSymbolUtil.isEmptyOrIgnoreName(JavaScriptUnusedSymbolUtil.java:42)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.github.beansoftapp.javascript.codeInsight.JavaScriptJSXCodeVisionProvider$1.collect(JavaScriptJSXCodeVisionProvider.java:102)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.codeInsight.hints.CollectorWithSettings.collectHints(InlayHintsUtils.kt:91)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.codeInsight.hints.InlayHintsPass$doCollectInformation$1.process(InlayHintsPass.kt:47)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.codeInsight.hints.InlayHintsPass$doCollectInformation$1.process(InlayHintsPass.kt:27)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1154)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
2022-09-05 17:22:22,667 [103092935]   INFO - STDERR -   at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:86)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR - Caused by: com.intellij.openapi.progress.ProcessCanceledException
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.throwIfCanceled(AbstractProgressIndicatorBase.java:157)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.checkCanceled(AbstractProgressIndicatorBase.java:147)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.checkCanceled(DaemonProgressIndicator.java:97)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.openapi.progress.util.ProgressWrapper.checkCanceled(ProgressWrapper.java:82)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.openapi.progress.impl.CoreProgressManager.doCheckCanceled(CoreProgressManager.java:143)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.openapi.progress.ProgressManager.checkCanceled(ProgressManager.java:219)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.openapi.progress.ProgressIndicatorProvider.checkCanceled(ProgressIndicatorProvider.java:23)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.extapi.psi.StubBasedPsiElementBase.getGreenStub(StubBasedPsiElementBase.java:350)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.lang.javascript.psi.impl.JSFunctionBaseImpl.doGetName(JSFunctionBaseImpl.java:168)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   at com.intellij.lang.javascript.psi.impl.JSFunctionBaseImpl.getName(JSFunctionBaseImpl.java:162)
2022-09-05 17:22:22,668 [103092936]   INFO - STDERR -   ... 24 more
beansoft commented 2 years ago

Not related, would you please try run this command in a terminal and copy the output for me: xcrun instruments -s devices

efstathiosntonas commented 2 years ago

xcrun instruments -s devices:

xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find instruments 2> /dev/null' failed with exit code 17664: (null) (errno=Invalid argument)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
efstathiosntonas commented 2 years ago

after some googling I've found that the instruments command has been removed from Xcode 13

I'm using react-native 0.68.3

beansoft commented 2 years ago

Ok, i’ll do some googing to see if any other way to get the iphone list

efstathiosntonas commented 2 years ago

@beansoft hi, any news in this one? Thanks

beansoft commented 2 years ago

Hi still no lucky, some one said that one can copy old XCode's instrument exe to new SDK dir, but I've not tried. This is a big change in the XCode SDK side, I'm still looking for if the new version React-Native tools by facebook resolved this issue.

efstathiosntonas commented 2 years ago

ok, thanks for the update!

beansoft commented 1 year ago

I've found it's not possible to fix this issue as there is broken in react-native 0.70.0 too. For me, by using https://docs.libimobiledevice.org/libimobiledevice/latest/ with their cli util, I can read the device name:

brew install libimobiledevice
ideviceinfo -s
DeviceName: iPhoneXRBean

then if you using command by React Native CLI, by: npx react-native run-ios --device or given a device name:

npx  react-native run-ios --device iPhoneXRBean
Then errors will be thrown by Facebook's tool:
info Found Xcode project "AwesomeProject.xcodeproj"
error Could not find a device named: "iPhoneXRBean". Available devices:
  - MyMac (F5256792-DDDD-DDDD-DDDD-DDDDDDDDD)

So it's not possible to fix it so far, as my tool built on-top of Facebook's Node.JS tool chain. According to https://reactnative.dev/docs/running-on-device#running-your-app-on-ios-devices you have to using Xcode to run in your device. By a temp solution, you can run it through Xcode one time, after that disconnect it, using my tool windows to start the React Packager tool, then double shake in device to connect to the metro server.