Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Safari Web Inspector with apps compiled for production

Is there a way (even using private methods) to use the Safari Web Inspector in apps built for production (enterprise apps for instance).

I tried to use _setDeveloperExtrasEnabled of WKPreferences, but still no luck in firing the inspector once the app is deployed.

Any other trick to help javascript developers debug their app, without having access to the source code?

In other words, is there a way to distribute an app that can be inspected with the Safari Web Inspector? (using private methods is fine)

like image 953
Luca Torella Avatar asked May 30 '16 11:05

Luca Torella


1 Answers

There is no way to do that with a Distribution (enterprise, ad-hoc, app-store) certificate. The only way to have the inspector enabled is by using a Developer certificate.

Therefore I created a new fastlane lane that will use the developer certificate to create the ipa, then I'm uploading it to Fabric. In this way I'm able to distribute to my JS devs a version of the app that can be debugged with the Safari Web Inspector.

gym(
  scheme: "xxx",
  workspace: "xxx.xcworkspace",
  export_method: "development",
  output_directory: "build/",
  codesigning_identity: 'iPhone Developer: yay',
  use_legacy_build_api: true,
  xcargs: "-arch='armv7')
like image 65
Luca Torella Avatar answered Oct 21 '22 23:10

Luca Torella