Instrumenting PlayStation 4/5 apps¶
To instrument a PlayStation 4/5 app insert the Suitest instrumentation code into every HTML file belonging to your application.
At this point you should have a working PlayStation 4/5 in your Suitest account.
Only
.pkg
package file extension is supported.
Patch packages not supported
Suitest does not support patch packages. In order to test your application, you need to upload a fully standalone application package.
Please note that WebMAF application packages are supported on PlayStation 4/5 devices, while Media SDK applications are supported on PlayStation 5 devices only.
Inserting instrumentation code¶
Copy and paste the code snippet from the Suitest configuration page into
every HTML file of your application. For best results put it as the
first script element in your HTML file right after the opening
<head>
tag.
Instrumentation library in production
When inserting the Suitest instrumentation library, ensure you do not accidentally release the app to production with the Suitest code included. Suitest code is intended for testing and could impact the user experience of your application.
External parameters
Suitest launches an application with external parameters.
In the case your application calls getExternalParameter
command and uses data,
please make sure that Suitest parameters will not break your application.
Using accessfunction
PlayStation platform works in a way that only a single listener for accessfunction
can be configured. Since Suitest instrumentation library needs such a listener, there is a potential conflict between the instrumentation library and the code of your application. Therefore, we strongly recommend using the following pattern to prevent potential race conditions with accessfunction
:
var previousAccessFunction = window.accessfunction;
window.accessfunction = function handler(val) {
var msg = JSON.parse(val);
// do some handler logic...
// optionally unregister itself if this handler should be called only once and correct message was received
if (window.accessfunction === handler) {
window.accessfunction = previousAccessFunction;
} else {
console.log('Unexpected accessfunction handler set, can not safely restore previous one');
}
// call previous handler - mandatory logic
previousAccessFunction && previousAccessFunction(val);
}
NOTE: This pattern can be used multiple times in the application codebase and is fully compatible with the instrumentation library.
Here is an example of a listener incompatible with the instrumentation library:
// INCORRECT - do not use this pattern
window.accessfunction = function(val) {
var mgs = JSON.parse(val);
// some handler logic
}
NOTE: Both code samples are simplified to demostrate the logic and are not in the production quality.
Uploading package to Suitest¶
You can upload the package on the configuration page. Suitest will automatically install or update the package on the device as necessary when you try running the app on this device.
If you use Suitest Network API you can also send the package with an API request. Suitest will automatically install or update the package on the device as necessary when you try running the app on this device.
Setting up Suitestify¶
You can optionally set up Suitestify with any HTML-based hosted application.