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

Not Able to Debug With Physical iOS Device, Only iOS Simulator #101

Open
JaydenJinx opened this issue Jan 1, 2025 · 1 comment
Open

Comments

@JaydenJinx
Copy link

JaydenJinx commented Jan 1, 2025

Hi. I’ve run into an issue where SweetPad won’t debug a physical iOS Device but works fine when trying to debug an iOS Simulator. I’ve confirmed that debugging an iOS Device directly through Xcode works fine, so my guess is this is a problem with SweetPad or VS Code (Cursor).

SweetPad Version: 0.1.49
Cursor Version: 0.44.9
VSCode Version: 1.93.1

This is the message I see when debugging a physical device. This message doesn’t pop up when debugging a simulator. I'm not sure why this message pops up because the app launches on the physical device just fine.

Screenshot 2025-01-01 at 2 47 06 PM
Log with iOS Simulator
* Executing task: sweetpad: launch 

🚀 Executing command:
xcodebuild -scheme '[PROJECT_NAME]' -configuration Debug -workspace '/Users/[USERNAME]/Desktop/[PROJECT_NAME]/frontend/[PROJECT_NAME].xcodeproj/project.xcworkspace' -destination 'platform=iOS Simulator,id=[DEVICE_ID]' -resultBundlePath '/Users/[USERNAME]/Library/Application Support/Cursor/User/workspaceStorage/[WORKSPACE_STORAGE_ID]/sweetpad.sweetpad/bundle/[PROJECT_NAME]' -allowProvisioningUpdates build

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:[DEVICE_ID], OS:18.2, name:iPhone 16 Pro }
{ platform:iOS Simulator, id:[DEVICE_ID], OS:18.2, name:iPhone 16 Pro }

----- xcbeautify -----
Version: 2.17.0
----------------------

[[PROJECT_NAME]] Processing empty-[PROJECT_NAME].plist  
[[PROJECT_NAME]] Compiling [PROJECT_NAME]App.swift  
[[PROJECT_NAME]] Compiling Item.swift  
[[PROJECT_NAME]] Compiling ContentView.swift  
[[PROJECT_NAME]] Copy arm64-apple-ios-simulator.swiftsourceinfo -> [PROJECT_NAME].swiftsourceinfo  
[[PROJECT_NAME]] Copy arm64-apple-ios-simulator.swiftmodule -> [PROJECT_NAME].swiftmodule  
[[PROJECT_NAME]] Copy arm64-apple-ios-simulator.abi.json -> [PROJECT_NAME].abi.json  
Signing [PROJECT_NAME].debug.dylib (in target '[PROJECT_NAME]' from project '[PROJECT_NAME]')  
Signing __preview.dylib (in target '[PROJECT_NAME]' from project '[PROJECT_NAME]')  
Signing [PROJECT_NAME].app (in target '[PROJECT_NAME]' from project '[PROJECT_NAME]')  
Build Succeeded  

🚀 Executing command:
open -a Simulator  

🚀 Executing command:
xcrun simctl install [DEVICE_ID] '/Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[PROJECT_NAME]-[UUID]/Build/Products/Debug-iphonesimulator/[PROJECT_NAME].app'  

🍭 Sweetpad: watch marker (start)  
🍩 Sweetpad: watch marker (end)  

🚀 Executing command:
xcrun simctl launch --console-pty --terminate-running-process [DEVICE_ID] [BUNDLE_ID]  

^C  
[BUNDLE_ID]: 45749  

✅ Task completed
Log with physical iOS Device
*  Executing task: sweetpad: launch 

🚀 Executing command:
xcodebuild -scheme '[PROJECT_NAME]' -configuration Debug -workspace '/Users/[USERNAME]/Desktop/[PROJECT_NAME]/frontend/[PROJECT_NAME].xcodeproj/project.xcworkspace' -destination platform\=iOS\,id\=[DEVICE_ID] -resultBundlePath '/Users/[USERNAME]/Library/Application Support/Cursor/User/workspaceStorage/[WORKSPACE_STORAGE_ID]/sweetpad.sweetpad/bundle/[PROJECT_NAME]' -allowProvisioningUpdates build


----- xcbeautify -----
Version: 2.17.0
----------------------

[[PROJECT_NAME]] Processing empty-[PROJECT_NAME].plist
Signing [PROJECT_NAME].app (in target '[PROJECT_NAME]' from project '[PROJECT_NAME]')
Build Succeeded

🚀 Executing command:
xcrun devicectl device install app --device [DEVICE_ID] '/Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[PROJECT_NAME]-[UUID]/Build/Products/Debug-iphoneos/[PROJECT_NAME].app'

[TIME]  Acquired tunnel connection to device.
[TIME]  Enabling developer disk image services.
[TIME]  Acquired usage assertion.
2%... 59%... 60%... 62%... 66%... 68%... 72%... 74%... 76%... 80%... 84%... 88%... 92%... 96%... Complete!
App installed:
? bundleID: [BUNDLE_ID]
? installationURL: file:///private/var/containers/Bundle/Application/[UUID]/[PROJECT_NAME].app/
? launchServicesIdentifier: unknown
? databaseUUID: [DATABASE_UUID]
? databaseSequenceNumber: 5848
? options: 

🍭 Sweetpad: watch marker (start)
🍩 Sweetpad: watch marker (end)

🚀 Executing command:
xcrun devicectl device process launch --console --json-output '/Users/[USERNAME]/Library/Application Support/Cursor/User/workspaceStorage/[WORKSPACE_STORAGE_ID]/sweetpad.sweetpad/_temp/json_ff83ac35' --terminate-existing --device [DEVICE_ID] [BUNDLE_ID]

^C
[TIME]  Acquired tunnel connection to device.
[TIME]  Enabling developer disk image services.
[TIME]  Acquired usage assertion.
Launched application with [BUNDLE_ID] bundle identifier.
Waiting for the application to terminate...
App terminated due to signal 2.

🚫 Command returned non-zero exit code
launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "sweetpad-lldb",
            "request": "attach",
            "name": "Debug frontend",
            "preLaunchTask": "sweetpad: launch"
        }
    ]
}
@hyzyla
Copy link
Collaborator

hyzyla commented Jan 4, 2025

Hello! Thanks for this issue. Could you send me a logs in debug console [1] and Output/LLDB panel [2]

CleanShot 2025-01-04 at 15 05 55@2x

CleanShot 2025-01-04 at 15 06 16@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants