2.1 KiB
2.1 KiB
Profiling an Application on iOS
How to profile a test application for iOS
Set up Your Mac OSX Environment
- Download Xcode
Set up Xcode
- Enable the Developer app on the iOS device
- Settings/General/Device Management: Select the Developer app and Trust
MongoProfiler
The MongoProfiler is a custom profiling template which includes
- Energy Log - this must be imported from the iOS device and should be captured untethered Captures battery level
- Activity Monitor - this can be captured via USB cable or wirelessly Captures CPU load
- Virtual Memory Trace - this can be captured via USB cable or wirelessly Captures memory usage
Run Profiler on the Mac
- Connect the iOS device to the Mac via USB cable
- Start Instruments on Mac
- Can be started from within Xcode or from the Spotlight Search
- Connect to the iOS device and select an app to profile
- Open a Custom profiling template and select
MongoProfiler - Start recording
- Start the application on the iOS device
- Stop recording in Instruments
Run Profiler Wirelessly on the Mac
- Ensure the Mac and iOS device are on the same WiFi network
- Connect the iOS device to the Mac via USB cable
- Pair the devices in Xcode See https://help.apple.com/xcode/mac/9.0/index.html?localePath=en.lproj#/devbc48d1bad
- Select Windows/Devices & Simulators
- Select the Devices tab, select the iOS device and select
Connect via network
- Disconnect the USB cable
- Follow the instructions from step 2 in
Run profiler on the Mac
Measuring Energy Usage on the iOS device
Unfortunately Instruments cannot measure Energy usage by recording from the Mac, but only from the iOS device.
- Select Settings/Developer/Logging on the iOS device
- Enable Energy
- Select
Start Recording(note this can be done before recording within Instruments for the other probes) - After the test is completed, select
Stop Recording - From within Instruments on the Mac (note this can be done using the
MongoProfilerso all probes are captured together)
- Select File,
Import Logged Data From Device