MaxAst / expo-share-extension

Expo config plugin for creating iOS share extensions with a custom view.
MIT License
205 stars 4 forks source link

Debugging help #36

Closed belle-chang closed 2 months ago

belle-chang commented 3 months ago

Hi Max,

Thanks again for all your great work on this expo plugin! We're in the process of implementing the share sheet for our application, and had some questions about debugging. What's the best way to see the console.log() and print statements for debugging purposes? We're experiencing an issue where our end-to-end flows work properly when testing on the simulator, but not when installed into physical devices (Button is failing to execute onPress fx). I attempted to look at the logs in the Console app, as well as attaching to the process in XCode but couldn't find any of my logs. Also, I noticed you use Alert.alert() in the firebase example, but I wasn't able to get the alert to show up -- do you know why that could be?

Again, thanks so much!!

MaxAst commented 3 months ago

Hi Belle, I've had similar issues before and always debug them like this:

  1. Create a release build and install it on your phone
  2. Connect phone to mac via usb
  3. Open Console app and select your phone in the Devices panel in the top left
  4. Navigate to what you want to share on your phone and press on the share button, so that your share extension is only a tap away
  5. Press on "Start" in the Console's toolbar at the top and open on your app / share extension
  6. Once you have reached the error in your flow (in your case Button failing to execute onPress), try to find a log where the process is equal to your share extension's bundle ID (should have a "ShareExtension" suffix, e.g. yourAppShareExtension)
  7. if you right click on that, you can select "Show Process 'yourAppShareExtension'" to only show the logs of your share extension.

Let me know if this helps. It would also be useful to know what type of data you're sharing, where you're sharing it from, and what the onPress function is doing

MaxAst commented 3 months ago

also keep in mind that share extensions have a memory cap of 100MB on real devices, so if it's a memory intensive function that gets called on press, the error would not occur on the simulator. You can check how much memory your share extension uses in debug mode, when you build & run the share extension via XCode

MaxAst commented 2 months ago

Hey @belle-chang, any luck? If so, I'd close the issue

MaxAst commented 2 months ago

closing this, feel free to comment here if you need more help