Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
GimmeJob
Sign in
Testing tools: hands-on guides · Chapter 09 / 09

Testing Tools

Mobile: adb, Logcat & Xcode Simulator

Mobile bugs need evidence from the device itself: which build was installed, what the system log said when the app crashed, which deep link was opened, which permission was denied. On Android the tools are adb (Android Debug Bridge) and Logcat in Android Studio. On iOS they are the Xcode Simulator, its command-line twin simctl, and the macOS Console app for real devices. This chapter gives the exact setup steps and the commands testers use every day.

Key factAndroidiOS
InstallAndroid Studio, or only the SDK platform-tools (contains adb)Xcode from the Mac App Store (macOS only)
Real deviceUSB or Wi-Fi debugging via Developer optionsConnect to a Mac. Logs in the Console app
LogsLogcat (Android Studio) or adb logcatConsole app, xcrun simctl spawn booted log stream
Emulator / simulatorAndroid Emulator (AVD Manager)Simulator (Xcode → Open Developer Tool → Simulator)
Identify the target (adb devices / simctl list) → clean state (pm clear / erase) → install the exact build → start log capture + screen recording → reproduce (deep link, push, location) → stop and pull files → attach: build number, device, OS version, steps, video, log excerpt

Connecting an Android device: Developer options, USB and wireless debugging

  1. On the phone, open Settings → About phone and tap Build number seven times until you see You are now a developer. On some vendors this is under Software information.
  2. Open Settings → System → Developer options and turn on USB debugging.
  3. Connect the phone by USB and accept the Allow USB debugging? prompt with the computer's RSA key fingerprint. Tick Always allow from this computer on your own test machine.
  4. On the computer run adb devices -l. The device must show the state device. unauthorized means the prompt wasn't accepted, and offline means you should reconnect the cable.
  5. Wireless (Android 11+): in Developer options turn on Wireless debugging → Pair device with pairing code, then run adb pair IP:PORT with the code shown, and finally adb connect IP:PORT. The phone and computer must be on the same network.
Wireless debugging settings on an Android phone
Official Android Developers screenshot: the Wireless debugging system setting on a Google Pixel phone.
adb devices -l                         # list targets with model and transport
adb -s emulator-5554 shell getprop ro.build.version.release   # Android version of one target
export ANDROID_SERIAL=R58M12345XY      # make one device the default for this terminal
Caveat: With more than one device or emulator attached, adb fails with more than one device/emulator. Use -s SERIAL, -d (only USB device) or -e (only emulator).
# Install / update / remove builds
adb install app-release.apk               # fresh install
adb install -r app-release.apk            # reinstall, keep data (upgrade test)
adb uninstall com.example.shop            # remove app and data

# Clean state without reinstalling
adb shell pm clear com.example.shop       # wipes app data and cache (like first launch)
adb shell am force-stop com.example.shop  # kill the app

# Open screens directly
adb shell am start -a android.intent.action.VIEW -d "shop://orders/42"
adb shell am start -a android.intent.action.VIEW -d "https://shop.example.com/promo"   # app link

# Permissions
adb shell pm grant  com.example.shop android.permission.CAMERA
adb shell pm revoke com.example.shop android.permission.ACCESS_FINE_LOCATION

# Evidence
adb exec-out screencap -p > screen.png                          # screenshot straight to your PC
adb shell screenrecord --time-limit 60 /sdcard/bug.mp4          # Ctrl+C to stop earlier
adb pull /sdcard/bug.mp4 .
adb bugreport bugreport.zip                                     # full system report for developers

# Device information for the bug report
adb shell getprop ro.product.model
adb shell dumpsys package com.example.shop | grep versionName
QA tip: pm clear plus a deep link reproduces "first launch from a marketing link" in seconds, which is a scenario that's slow to set up by hand. Text input for long fields is adb shell input text "hello%sworld" (%s is a space).

Logcat in Android Studio: filters, crashes and saved queries

  1. Run the app on the device or emulator, then open View → Tool Windows → Logcat.
  2. Choose the device in the dropdown at the top of the Logcat window.
  3. Type a query in the filter field. Press Ctrl+Space to see suggestions.
  4. Start with package:mine, which means all packages of the open project. Then narrow it down:
package:mine level:ERROR
package:mine is:crash
package:mine (tag:OkHttp | tag:Retrofit)
package:com.example.shop -tag:Choreographer
package:mine message:"timeout" age:5m
QueryMeaning
level:WARNThat level and higher (VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT)
is:crashApplication crashes, Java or native
is:stacktraceAnything that looks like a stack trace
tag: / -tag:Include or exclude a tag
tag~:Net.*Regular expression match
age:5mOnly the last 5 minutes
  • Click the star next to a query to save it as a favourite. Use Split Panels (right-click the log) to watch two queries or devices side by side.
  • When the app process restarts after a crash, Logcat prints that the process ended and started again. The lines just before that are the crash.
The Logcat window in Android Studio
Official Android Developers screenshot: the Logcat window formats logs by time, tag, level and message.

Without Android Studio, use the command line:

adb logcat -c                              # clear old logs first
adb logcat -v time > logcat.txt            # save everything with timestamps
adb logcat '*:E'                           # errors and above only
adb logcat -b crash                        # crash buffer only
adb logcat --pid=$(adb shell pidof -s com.example.shop)   # only the running app

Xcode Simulator: devices, screenshots, location and appearance

  1. Open Xcode → Open Developer Tool → Simulator. Choose a device in File → Open Simulator (for example an older, smaller iPhone and the newest one).
  2. Install a test build by dragging the .app bundle onto the Simulator window, or run it from Xcode.
  3. Screenshots: File → Save Screen (Cmd+S). Video: File → Record Screen.
  4. Location: Features → Location → pick a preset such as City Run, or choose Custom Location… and enter coordinates.
  5. Appearance and accessibility: Features → Toggle Appearance (light/dark). Larger text is in the Simulator's Settings app → Accessibility → Display & Text Size.
  6. Device actions: Device → Rotate Left / Right, Device → Shake, Device → Home, and I/O → Keyboard → Toggle Software Keyboard.
  7. Reset when you need a clean device: Device → Erase All Content and Settings….
Caveat: The Simulator runs on your Mac's hardware and doesn't fully reproduce real-device behaviour: push notification delivery through APNs, camera, Bluetooth, real performance and memory pressure. Confirm device-specific bugs on a physical iPhone.

xcrun simctl controls simulators from scripts. booted means "the simulator that is currently running".

xcrun simctl list devices                                  # all simulators and their UDIDs
xcrun simctl boot "iPhone 16"                              # start a simulator by name
xcrun simctl install booted Shop.app
xcrun simctl launch booted com.example.shop

xcrun simctl openurl booted "shop://orders/42"             # deep link / universal link
xcrun simctl push booted com.example.shop push.json        # local push payload (no APNs)
xcrun simctl location booted set 50.4501,30.5234           # Kyiv
xcrun simctl privacy booted grant photos com.example.shop  # or revoke / reset
xcrun simctl status_bar booted override --time 9:41 --batteryLevel 100 --cellularBars 4
xcrun simctl io booted screenshot shot.png
xcrun simctl io booted recordVideo bug.mp4                 # Ctrl+C to stop
xcrun simctl keychain booted add-root-cert charles-root.pem   # trust a proxy certificate
xcrun simctl erase all                                     # factory-reset all (shut down) simulators

An example push.json for testing notification handling:

{
  "aps": { "alert": { "title": "Order shipped", "body": "Order #42 is on its way" }, "badge": 1 },
  "orderId": 42
}
QA tip: status_bar override gives clean, identical screenshots for visual comparisons and store listings. Clear it with xcrun simctl status_bar booted clear.

iOS logs: Console on macOS and simulator log stream

Real iPhone or iPad

  1. Connect the device to the Mac and trust the computer on the device.
  2. Open the Console app on the Mac and select the device under Devices in the sidebar.
  3. Click Start to stream messages. Use the search field to filter by process (your app's name) or by text, and Action → Include Info Messages / Include Debug Messages if you need more detail.
  4. Reproduce the bug, note the exact time, and look for errors and faults around that moment.
  5. Crash reports are in Xcode's Window → Devices and Simulators for the selected device, and in Settings → Privacy & Security → Analytics & Improvements → Analytics Data on the device itself.

Simulator

xcrun simctl spawn booted log stream --level debug \
  --predicate 'process == "Shop"'

Cheat sheet

TaskCommand or action
List Android targetsadb devices -l
Install / upgrade a buildadb install -r app.apk
Reset app to first launchadb shell pm clear PACKAGE
Open a deep link (Android)adb shell am start -a android.intent.action.VIEW -d "URI"
Screenshot / video (Android)adb exec-out screencap -p > s.png / adb shell screenrecord
Only your app's errorsLogcat: package:mine level:ERROR
CrashesLogcat: is:crash, CLI: adb logcat -b crash
Full reportadb bugreport bugreport.zip
Open a deep link (iOS Simulator)xcrun simctl openurl booted "URI"
Fake push (iOS Simulator)xcrun simctl push booted BUNDLE_ID push.json
Fake locationSimulator → Features → Location, or simctl location
Real iPhone logsConsole app → device → Start
Hands-on lab: build a complete Android bug evidence pack

Use any app you're testing, shown here as the package com.example.shop. Use the emulator or a test phone.

  1. Run adb devices -l and copy the model and serial into your notes.
  2. Record the app version with adb shell dumpsys package com.example.shop | grep versionName.
  3. Reset to a clean state with adb shell pm clear com.example.shop, then clear old logs with adb logcat -c.
  4. Start log capture in terminal 1: adb logcat -v time > logcat.txt.
  5. Start a recording in terminal 2: adb shell screenrecord --time-limit 120 /sdcard/bug.mp4.
  6. Reproduce the bug. Use a deep link if the bug starts on a specific screen: adb shell am start -a android.intent.action.VIEW -d "shop://orders/42".
  7. Stop both commands with Ctrl+C. Take a final screenshot with adb exec-out screencap -p > final.png, and pull the video with adb pull /sdcard/bug.mp4 ..
  8. In Android Studio's Logcat (or by searching logcat.txt), use package:mine is:crash or level:ERROR to find the first relevant error. Copy about 20 lines around it. Don't attach a 50 MB log without pointing to the important line.
  9. Attach to the bug: device, OS version, app version, exact steps, bug.mp4, final.png and the log excerpt with its timestamp.

iOS Simulator version: xcrun simctl erase (on a shut-down device) → boot → install → xcrun simctl io booted recordVideo bug.mp4 → xcrun simctl openurl booted "shop://orders/42" → xcrun simctl spawn booted log stream --predicate 'process == "Shop"' > ios.log.

Official adb guide · Logcat in Android Studio

Summary

  • Identify the exact device or simulator first (adb devices -l, simctl list). Most "wrong device" mistakes start there.
  • pm clear / erase, deep links, permission grants and fake locations or pushes let you reach any app state quickly and reproducibly.
  • Logcat queries such as package:mine level:ERROR and is:crash turn a wall of logs into evidence. On iOS, use the Console app or log stream.
  • Attach the build number, device, OS version, steps, a screen recording and a focused log excerpt to every mobile bug report.

Source registry

Verified 22 Nov 2026
Android Debug Bridge (adb)

Device listing, USB and wireless debugging, installing apps, activity manager and file transfer

Google Android · verified
Source ↗
View logs with Logcat (Android Studio)

Logcat window, query keys such as package:mine, level, is:crash, age and split panels

Google Android · verified
Source ↗
Logcat command-line tool

adb logcat buffers, filters and output formats

Google Android · verified
Source ↗
Running your app in Simulator or on a device

Choosing and running Simulator destinations from Xcode

Apple · verified
Source ↗
WWDC20: Become a Simulator expert

simctl commands for status bar overrides, push, privacy, recording and root certificates

Apple · verified
Source ↗
Console User Guide: View log messages

Streaming and filtering live log messages from a connected iPhone or iPad

Apple · verified
Source ↗