Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a hybrid android app, and I'd like to test everything in a regular desktop browser first because the android emulator is incredibly slow in deploying. The problem is that in the emulator I am asked for identification when I build the first time, but when I just run the index.html in a browser, I am not. This leads to the forcetk client being undefined and all the problems that entails. Is there a way to include logging in to Salesforce in this type of local testing as well?

share|improve this question

I've faced this issue as well over the years. The SDK does NOT directly support testing your hybrid apps on the browser because the oAuth dance happens via a WebView that's triggered by Cordova specific APIs such as onDeviceReady which fire only on the phone (device/ emu). This is the reason why you typically get the forcetk undefined on your browser while it works on devices/ emulator as it's handled by Mobile SDK using Cordova under the hood.

Having mentioned that, I believe it should be possible to do so if you can modify the auth flow to manage forcetk instantiation in your custom code while bypassing the Mobile SDK oAuth dance - however that can be a bit complex.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.