vscode-react-native icon indicating copy to clipboard operation
vscode-react-native copied to clipboard

[Documentation][Bug]Say that we need to install ideviceinstaller for debugging in iOS

Open digeff opened this issue 10 years ago • 5 comments

In the documentation we should say that we need to install ideviceinstaller as a required step for debugging in iOS

digeff avatar Apr 11 '16 22:04 digeff

Specifically we need brew install libimobiledevice ideviceinstaller

MSLaguana avatar Apr 11 '16 22:04 MSLaguana

At least the console should tell me about that error, but for me (node 5.7) it does not. This changes fix that (on my machine): https://github.com/mroswald/vscode-react-native/commit/d11194f3e7ae89c7f6faecfc2c2716da2e7aec9c

Anybody else can reproduce that?

before:

[vscode-react-native] [Error : 0101]  Cannot debug application: Error while executing command 'ideviceinstaller -i /Users/**/ios/build/Build/Products/Debug-iphoneos/**.app': spawn ideviceinstaller ENOENT

after:

[vscode-react-native] [Error : 0201]  Cannot debug application: Unable to find ideviceinstaller. Please make sure to install Homebrew (http://brew.sh) and then 'brew install ideviceinstaller: Error while executing command 'ideviceinstaller -i /Users/**/ios/build/Build/Products/Debug-iphoneos/**.app': spawn ideviceinstaller ENOENT

mroswald avatar Apr 28 '16 08:04 mroswald

It seems wrong that: err.code != err.innerError.code we should probably copy the innerError code to the outer error when we are creating them

digeff avatar Apr 28 '16 16:04 digeff

Typically the wrapped errors are intended for cases where we don't know/understand the internal error, because it is from an external system and thus it doesn't have an error code. I'm inclined to say that wrapping our own errors is the bug in this case, and @mroswald's fix is a reasonable fix but it might be more appropriate to work out why we are wrapping the error and stop that (and see if we're making the same mistake elsewhere)

MSLaguana avatar Apr 28 '16 16:04 MSLaguana

@MSLaguana I know understand your text after reading the code :-)

The error is wrapped in a new NestedError in the CommandExecutor:

    private generateRejectionForCommand(command: string, reason: any): Q.Promise<void> {
        return Q.reject<void>(ErrorHelper.getNestedError(reason, InternalErrorCode.CommandFailed, command));
    }

and the expected errorCode is numeric, so maybe this is the reason why this error is wrapped. In this case (<any>err).code === "ENOENT" can never be true. My suggestion would be:

if ((<any>err).errorCode === 101 && (<any>err).innerError.code === "ENOENT") {

I'm totally fine with wrapping these errors in understandable, well-formatted ones

mroswald avatar May 09 '16 13:05 mroswald