Performance Injector

Performance Injector

The GameBench Performance Injector is a desktop app for MacOS and Windows that ‘injects’ performance monitoring into pre-built Android and iOS apps.

No source code is required, you just drop your app bundle (.apk or .ipa) onto the GUI and it produces a modified app bundle ready for installation on your test devices.

1. Download

2. Signing in to the GameBench server

To sign in you must first specify the server URL. If you chose to use our server this will be https://web.gamebench.net/ but if your company opted to self-host you will need to get the server address. Use the Google IAP options dropdown if your self-hosted server is in Google Cloud and has been configured to use Google’s Identity Aware Proxy (IAP) feature.

Your email address must have been previously registered on that server. You can sign in with either a traditional password-based login, or via Single Sign On (SSO) if you have got that enabled.

Once you are signed in the app will change to the main page where you can drag’n’drop app bundles for injection.

3. Injecting Android Apps

Once you have signed in with your GameBench credentials, you can simply drag your input .apk into the window.

By default the output .apk will be code-signed with a generated Java keystore, and will therefore contain a generated certificate. This is good enough for most cases, but it is vital to know that some apps will refuse to run if the certificate does not have expected properties. This is especially true for multiplayer games where developers want to prevent players cheating by using a hacked .apk. If your game or app implements such certificate checking you will either need to use the same keystore as used in production builds or obtain a private .apk from your dev team which has the certificate check disabled.

To specify a different keystore, go to the options page via the menu button in the top right, and then click on the link in the ‘Android’ section to specify the keystore file. You will be asked for your keystore’s password during the injection process.

3.1. Deploying the injected Android app

To deploy the output .apk to a physical device - a process often known as ‘sideloading’ - you will first need to make some changes in the Android settings app on the device:

Next you will need a command-line tool called adb, which is part of the Android Platform Tools. Just download the correct .zip for your OS from that website and unzip it. To deploy your .apk to the device just run the command:

adb install YourApp_gb.apk

3.2. Running the injected Android app


Once the .apk is installed you can launch it normally, and your app should now show a small frames-per-second indicator like the one pictured here.

Exercise whichever parts of your app you want to profile and then send your app into the background, e.g. by pressing the home button. When the app is backgrounded the session will be closed and the captured performance data will be uploaded to the GameBench server. For this reason it is important that you do NOT kill your app from Android's task manager, you must be sure to only send it to the background.

Once the session data has uploaded you should see a brief ’toast’-style notification, and the session will appear on the GameBench web dashboard. If you are using the default GameBench server this will be at :

https://web.gamebench.net/dashboard/user/sessions

4. iOS Apps

ℹ️
Injecting iOS apps is only supported on MacOS.

There are two ways to code-sign injected iOS apps. Firstly you can use an Apple developer account, which means Injector will communicate with Apple’s developer portal to access the necessary certificate and provisioning profile. Alternatively you can use pre-existing codesigning assets - .p12 and .mobileprovision files - if your development team is able to share them with you.

4.1. Using an Apple developer account

From the main app, open the options page via the cog button in the top-right corner and then locate and press the ‘Sign in with Apple ID’ button.

IMPORTANT (1 of 3): The Apple ID you sign in with must be registered as a member of your app’s development team. Your team membership must also include the ‘Certificates & Profiles’ permission that is typically granted to iOS developers. This is so Performance Injector can generate the code-signing certificate and provisioning profile needed to install locally-built apps to your iPhone.

IMPORTANT (2 of 3): If you are using a personal iPhone that may not be registered on the Apple portal, connect it to your Mac while Performance Injector is active and you should see a message like this appear in the bottom of the window : Doing this ensures that Performance Injector knows about your particular iPhone and will ensure it is included in the provisioning profile embedded in the output app bundle. You only need to do this once.

IMPORTANT (3 of 3). On your test iPhone, ensure that Developer Mode is enabled in the Settings app. You only need to do this once.

4.2. Using code-signing asset files

From the main app, open the options page via the cog button in the top-right corner and then locate the ‘Local Code-Signing Assets’ section. Press the “Add Files” button to add references to the .p12 and .mobileprovision files your iOS devevelopment team have provided.

Injector will always try to use code-signing assets before falling back to the Apple developer account.

4.3. Deploying the injected iOS app

To deploy to a test device you will need an open-source utility named ideviceinstaller. This can be installed via HomeBrew with the command:

brew install ideviceinstaller

Once ideviceinstaller is installed on your Mac, you can deploy your app bundle to your phone:

ideviceinstaller -i YourApp_gb.ipa

4.4. Running the injected iOS app

Once your .ipa or .app has been deployed you can launch it in the normal way.

Exercise whichever parts of your app you want to profile and then send your app into the background, e.g. by switching to a different app or to the home screen. When the app is backgrounded the session will be closed and the captured performance data will be uploaded to the GameBench server. For this reason it is important that you do NOT kill your app from the task manager, you must be sure to only send it to the background.

Once the session data has uploaded the session will appear on the GameBench web dashboard. If you are using the default GameBench server this will be at :

https://web.gamebench.net/dashboard/user/sessions

Last updated on