sweetpad-dev / sweetpad

Develop Swift/iOS projects using VSCode
https://marketplace.visualstudio.com/items?itemName=sweetpad.sweetpad
MIT License
586 stars 19 forks source link

Issue with running on device #40

Closed rudrankriyam closed 2 months ago

rudrankriyam commented 2 months ago

I am trying to build it on device. Simulator works perfectly but I am getting the following error:

** BUILD SUCCEEDED ** [20.524 sec]

🚀 Executing command:
xcrun devicectl device install app --device 00008120-000A1C992E50C01E /Users/rudrankriyam/Library/Developer/Xcode/DerivedData/Meshing-dlhegtlubpdtxdatwwbgjjrmxzjk/Build/Products/Debug-iphoneos/Meshing.app/Meshing

ERROR: Failed to install the app on the device. (com.apple.dt.CoreDeviceError error 3002 (0xBBA))
       NSLocalizedFailureReason = The provided item to be installed is not of a type that CoreDevice recognizes.
       NSURL = file:///Users/rudrankriyam/Library/Developer/Xcode/DerivedData/Meshing-dlhegtlubpdtxdatwwbgjjrmxzjk/Build/Products/Debug-iphoneos/Meshing.app/Meshing

🚫 Command returned non-zero exit code

Any idea why it cannot recognize the device? I am running iOS 18 R C and Xcode 16.0 R C

hyzyla commented 2 months ago

Thanks for reporting the issue. I'll wait for iOS 18 release for few days to update my phone. Then I'll try to reproduce the issue

schwjustin commented 2 months ago

I get the same error trying to run on my device on iOS 17

hyzyla commented 2 months ago

Sorry for that, I've made silly mistake in previous commits. Fixed in v0.1.33

schwjustin commented 2 months ago

@hyzyla btw is there a way to view the logs in vs code rather than keeping xcode open to view print statements from the swift code?

hyzyla commented 2 months ago

@schwjustin I use devicectl to install and launch app on device and seems like --console option was added in Xcode 16. So it's not hard to add it to extension. Or do you mean another kind of of logs, not from stdout/stderr?

image

schwjustin commented 2 months ago

I mean logs such as print("") lines in my app's swift code

hyzyla commented 2 months ago

@schwjustin In the latest version (0.1.34), I've added the --console option for launching on physical devices. This option will redirect stdout to the extension, allowing you to print debug information on a physical device.

--console — Attaches the application to the console and waits for it to exit. devicectl will wait for the app to terminate. Catchable signals sent to devicectl are forwarded to the app. If the app is not already running, its standard streams will be connected to devicectl's standard streams.