Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Moved the Android content to it's own page

No matter the route you take, you must ensure that your project is using the included jscore framework option first. That is unless you are using SDK 7.0.x+ for Safari while debugging with iOS. In 7.0.x+, if that tag is not in your tiapp.xml file, it defaults to true and uses the JSCore bundled in iOS.

Enable use-jscore-framework

With Titanium SDK 6.x, developers must add a tag to enable the iOS debugger in order to use Safari (or iOS-webkit-debug-proxy). With SDK 7.x and later, this value is assumed to be true unless you explicitly add the tag with false as the value.

The key is to enable the use-jscore-framework option in tiapp.xml:

 

Code Block
linenumberstrue
languagexml
<tiapp>
    ...
    <ios>
        ...
        <use-jscore-framework>true</use-jscore-framework>
        ...
    </ios>
    ...
</tiapp>

 

Once enabled, this will force the SDK to use the pre-packaged JSCore framework/engine as the JavaScript engine internally (rather than our older TiCore framework).

...

  1. Launch the app on the device or a simulator. Note: if using a device, make its connected by an USB cable before debugging.
    1. Launch you application via Studio or command-line: appc run -p ios
  2. Launch Safari and enable the Develop mode (Safari > Preferences > Advanced and enable Show Develop menu in menu bar).
    Image Removed Note: it is important to have the Web Inspector enabled to allow connections for debugging. Otherwise, neither Studio nor Safari's debugger will be able to connect to the device using the web-inspector based protocol.
    Image Added
  3. Once the app is up and running, connecting to the debugger depends on whether you are using a simulator or device.
    1. Simulator: Safari > Developer > Simulator > JSContext
    2. Device: Safari > Developer > <device name> > JSContext

...

  1. Launch the simulator.
  2. Open Safari > Develop > Simulator.
  3. Ensure Automatically Show Web Inspector for JSContexts and Automatically Pause Connecting to JSContexts are both enabled.
  4. Launch the app/build via Studio or the CLI. You should be able to connect and control the debugger before the app fully launches.

Using Google Chrome and ios-webkit-debug-proxy

...

From our experience, we haven't been able to reliably use this to hit breakpoints and inspect the state of the app. However, we have found that the Console tab works for evaluating arbitary code in the context of the app.

  1. Launch the Simulator.
  2. Launch the app.
  3. Open Terminal and start ios-webkit-debug-proxy.
  4. Open Google Chrome to  http://localhost:9221/ .
  5. Click on the link for the simulator ( http://localhost:9222/ ).
  6. Click on the  http://localhost:9222/devtools/devtools.html?ws=localhost:9222/devtools/page/1  for the inspectable page.