# Debugging on iOS

# Starting up

  1. If you haven't setup Impact for the first time yet, follow the instructions Pitcher Impact initial setup section.
  2. Start iOS simulator and start Pitcher application
  3. Select a preferred instance
  4. When UI opens, launch the interactive you want to debug
  5. Open Safari and activate Develop menu (needs to be done once) safari-settings
  6. Click DevelopSimulatorInteractive name safari-debugger
  7. 🎉 Safari debugger should be opened as attached to your application in WebView. You are now ready to start watching your changes in your Vue application

# Updating package.json

Before starting, we need to configure our package.json to automate replacing files in simulator folders.

  1. Go to admin panel and select the instance
  2. When you have opened your instance, you will see your file list. Find the file id of your application (example: 720440) file-id-example
  3. In package.json find ios:watch script and replace HERECOMESMYFILEID with the file id you copied in step 2
  4. 🎉 You are now ready to watch changes in your Vue project

# Start debugging

After starting up the simulator and updating your package.json, Run: npm run ios:watch in terminal

This setup will now:

  • watch your file changes in your Vue project
  • build your code on each change
  • replace interactive files in pitcher folders

WARNING

You still need to refresh WebView (command + R from Safari debugger) to see changes

# Finding local database

To find the local DB for debugging in SQLite editor, run this in terminal:

find ~/Library/Developer/CoreSimulator/Devices -name pitcher.sql

Open this file with an SQL editor.

# FAQ

# Logging in SFDC asks for verification code

Verification codes are sent to developer group mails. Simply ask someone in your team to get access to the groups.

# ios:watch running but my changes are not applied

This issue might occur when you update XCode or simply delete Pitcher.app in your simulator. The reason is that a new simulator & simulator folder is created under ~/Library/Developer/CoreSimulator/Devices folder, and your files are copied to the old folder, therefore you can't see the updates inside simulator. To get rid of this issue:

  • Go to ~/Library/Developer/CoreSimulator/Devices
  • Search for the fileID
  • Find out which folder is the active folder that is used by the simulator inside safari devtools
  • Delete duplicated folder (the one that is not used) from the file system