bazysong
bazysong

Reputation: 379

How to debug ios8 share extension?

I tried two ways to debug while the extension is running:

a. using NSlog, such as

    NSLog(@"%@", ((NSExtensionItem *)self.extensionContext.inputItems.firstObject).userInfo);

but no log shows.

b. using code like

    p self.extensionContext

in the lldb debug mode, but it tells me

    error: property 'extensionContext' not found on object of type 'ShareViewController *'
    error: 1 errors parsing expression

Upvotes: 1

Views: 295

Answers (2)

byJeevan
byJeevan

Reputation: 3838

As mentioned HERE, you can debug share extension by attaching target

Debug -> Attach Process -> By process name or PID

enter image description here

In our case, PID will be Share extension bundle name as mentioned in Share Extension Target.

Upvotes: 0

Didats Triadi
Didats Triadi

Reputation: 1502

You need to use simulator debug. On Simulator, click on Debug Menu, Open System Log.

Upvotes: 1

Related Questions