nisargjhaveri / vscode-ios-debug

iOS debugging in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=nisargjhaveri.ios-debug
93 stars 11 forks source link

Build Failure #11

Closed mkaulfers closed 1 year ago

mkaulfers commented 1 year ago
** BUILD FAILED **

The following build commands failed:
        CreateBuildDirectory /Users/myName/Library/Developer/Xcode/DerivedData/Summit_Pro-hjptjwluxolhovdqbtmwjrzctoqq/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Debug-iphonesimulator
        CreateBuildDirectory /Users/myName/Library/Developer/Xcode/DerivedData/Summit_Pro-hjptjwluxolhovdqbtmwjrzctoqq/SourcePackages/checkouts/nanopb/build/Debug-iphonesimulator
(2 failures)

I have the following tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "process",
            "command": "xcodebuild",
            "args": [
                "-configuration", "Debug", 
                "-sdk", "${command:ios-debug.targetSdk}",
                "-allowProvisioningUpdates",
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

And the following launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "lldb",
            "request": "launch",
            "program": "${workspaceFolder}/build/Debug-${command:ios-debug.targetSdk}/Summit Pro.app",
            "iosBundleId": "com.summitpro.ios",
            "iosTarget": "select",
            "preLaunchTask": "${defaultBuildTask}"
        },
        {
            "name": "Attach",
            "type": "lldb",
            "request": "attach",
            "program": "${workspaceFolder}/build/Debug-${command:ios-debug.targetSdk}/Summit Pro.app",
            "iosBundleId": "com.summitpro.ios",
            "iosTarget": "select",
        },
    ]
}

I also have installed the Swift and CodeLLDB extensions.

mkaulfers commented 1 year ago

Wanted to get back here and share an update. I fixed the tasks.json by manually toying with the xcodebuild and I am now getting build succeeded, however it's not deploying it to the simulator.

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "process",
            "command": "xcodebuild",
            "args": [
                "-configuration", "Debug",
                "-scheme", "Summit Pro", 
                "-sdk", "${command:ios-debug.targetSdk}",
                "-target", "iOS",
                "-arch", "arm64"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

Screenshot 2023-06-07 at 2 04 43 PM

nisargjhaveri commented 1 year ago

Thanks for reporting this, glad you could fix the build issue.

For the deploying to simulator issue, can you please mention the logs as well? You can get the logs from navigating to the Output panel, selecting "iOS Debug" from the menu. The logs might help giving more details on what might've gone wrong while trying to install.

mkaulfers commented 1 year ago

@nisargjhaveri thanks for replying, I figured out that the issue was related to the build path. They did not match so it would fail to deploy to the simulator, despite building successfully. I ended up correcting that and viola, it's working now. Final question, is it possible to get the terminal to output what XCode would normally display? I looked through a few settings and couldn't find anything to show the app specific run-time logs.

nisargjhaveri commented 1 year ago

Final question, is it possible to get the terminal to output what XCode would normally display? I looked through a few settings and couldn't find anything to show the app specific run-time logs.

Do you mean the logs while running the app? That should already be visible in the "Debug Console" when running.