cancel
Showing results for 
Search instead for 
Did you mean: 

Profiling/Debugging FSA Android Tablet

Highlighted
Retired
Retired

Profiling/Debugging FSA Android Tablet

When optimizing or troubleshooting performance on FSA Android Tablet, you may find it useful to profile the app to see where execution time is spent. This can give you and Customer Support direction by showing you where to focus your efforts.

Because FSA is a hybrid app, you can use Google Chrome's JavaScript Profiler to generate a CPU profile. There are three basic steps to do that:

  1. Install a debug build.
  2. Set up your device for remote debugging.
  3. Connect your Android device to Chrome.
  4. Start profiling.

I go over these steps in detail below.


Requirements

  • Chrome 32 or later on your development machine.
  • A USB cable to connect your Android device to your development machine.
  • Android 4.0 or later.
  • Chrome for Android installed on your Android device.

Step 1: Install a debug build.

  • Request a debug build of FSA Android Tablet for your release from Customer Support.
  • Install the APK file onto your Android device.

Step 2: Set up your device for remote debugging

  • Enable developer options and debugging. On Android 4.1 and lower, the Developer options screen is available by default. On Android 4.2 and higher, you must enable this screen as follows:
  • Open the Settings app.
  • (Only on Android 8.0 or higher) Select System.
  • Scroll to the bottom and select About phone.
  • Scroll to the bottom and tap Build number 7 times.
  • Return to the previous screen to find Developer options near the bottom.
  • Enable USB debugging at Settings > Developer options > Enable USB debugging.


Step 3: Connect your Android device to Chrome.

  • On you development machine, open Chrome. You should be signed into Chrome with one of your Google accounts. Remote debugging does not work in Incognito Mode or Guest Mode.
  • Open DevTools at View > Developer > Developer Tools.
  • In DevTools, click the Main Menu icon and then select More tools > Remote devices.


  • In DevTools, click the Settings tab, if another tab is showing.
  • Make sure that Discover USB devices is enabled.


  • Connect your Android device directly to your development machine using a USB cable. Don't use any intermediate USB hubs. If this your first time connecting your Android device to this development machine, your device shows up under Unknown, with text Pending Authorization below it.


  • If your device is showing up as Unknown, accept the Allow USB Debugging permission prompt on your Android device. Unknown is replaced with the model name of your Android device. The green circle and the Connected text indicate that you are all set to remotely debug your Android device from your development machine.


Note: If you have any issues during the discovery process, you can restart it by selecting Settings > Developer Options > Revoke USB Debugging Authorizations on your Android device.

Step 4: Start profiling.

  • If you don't already have Chrome open on your Android device, open it now.
  • Back in DevTools on your development machine, click the tab that matches your device's model name. At the top of this page, you see your Android device's model name, followed by its serial number. Below that, if ServiceMax FSA is running, you'll see a section for it labeled ServiceMax Field Service Application.
  • In that section, click Inspect to open the profiling tools.

  • Start recording immediately before the action you want to profile.
  • Perform the action and then stop recording.
  • Save the resulting .cpuprofile file.

You can read the .cpuprofile file by loading it into the JavaScript Profiler in Chrome. It shows exactly which JavaScript functions are taking the most time. This is the file that you would send to Customer Support.

Happy optimizing!

0 Likes
Reply