Shake-to-Report Bug Reporting Feature for Mobile App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Shake-to-Report Bug Reporting Feature for Mobile App
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Shake-to-Report (Bug Submission by Shaking) in Mobile Apps

Shake-to-Report is a pattern where a user or tester shakes their device and receives a bug submission form with an automatically captured screenshot and diagnostic information. For internal teams—it's more convenient than TestFlight feedback. For beta testers—the barrier to entry is much lower than filling out a form manually.

Shake Detection

iOS

// UIWindow subclass to intercept shake events
class FeedbackWindow: UIWindow {
    override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
        if motion == .motionShake {
            FeedbackManager.shared.presentFeedbackForm()
        }
        super.motionEnded(motion, with: event)
    }
}

// Usage in SceneDelegate
func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
    options connectionOptions: UIScene.ConnectionOptions) {
    if let windowScene = scene as? UIWindowScene {
        window = FeedbackWindow(windowScene: windowScene)
        window?.rootViewController = UIHostingController(rootView: ContentView())
        window?.makeKeyAndVisible()
    }
}

Overriding UIWindow is the standard approach, requires no SwiftUI-specific code, and works with any architecture.

Android—Accelerometer

Android doesn't have a built-in "shake" event—detect it via the accelerometer:

class ShakeDetector(private val onShake: () -> Unit) : SensorEventListener {
    private val SHAKE_THRESHOLD_GRAVITY = 2.7f
    private val SHAKE_SLOP_TIME_MS = 500
    private var lastShakeMs: Long = 0

    override fun onSensorChanged(event: SensorEvent) {
        val gX = event.values[0] / SensorManager.GRAVITY_EARTH
        val gY = event.values[1] / SensorManager.GRAVITY_EARTH
        val gZ = event.values[2] / SensorManager.GRAVITY_EARTH
        val gForce = sqrt(gX * gX + gY * gY + gZ * gZ.toDouble()).toFloat()

        if (gForce > SHAKE_THRESHOLD_GRAVITY) {
            val now = System.currentTimeMillis()
            if (lastShakeMs + SHAKE_SLOP_TIME_MS > now) return
            lastShakeMs = now
            onShake()
        }
    }

    override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {}
}

// Registration in Activity/Fragment
val sensorManager = getSystemService(SENSOR_SERVICE) as SensorManager
val shakeDetector = ShakeDetector { showFeedbackDialog() }
sensorManager.registerListener(
    shakeDetector,
    sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
    SensorManager.SENSOR_DELAY_UI
)

SHAKE_SLOP_TIME_MS = 500 prevents multiple triggers from a single shake. A threshold of 2.7g is a compromise between sensitivity and false positives from walking.

Automatically Collected Context

Upon shake, before showing the UI:

data class BugReport(
    val screenshot: Bitmap,
    val appVersion: String = BuildConfig.VERSION_NAME,
    val buildNumber: String = BuildConfig.VERSION_CODE.toString(),
    val osVersion: String = "Android ${Build.VERSION.RELEASE}",
    val device: String = "${Build.MANUFACTURER} ${Build.MODEL}",
    val currentScreen: String = screenTracker.currentScreenName,
    val recentLogs: List<String> = LogBuffer.getLast(50),  // last 50 log lines
    val memoryInfo: String = getMemoryInfo(),
    val networkType: String = getNetworkType()
)

recentLogs—if your app has an in-memory log buffer (Timber tree writing to a ring buffer), the bug report immediately contains the last events. The developer sees everything that happened 30 seconds before the shake.

Accessibility Alternatives

Shake is inconvenient for users with tremor or those who keep their device on a desk. For QA and beta programs, add alternative triggers:

  • Long-press on logo or version in "About"
  • Hidden menu via triple-tap on empty screen area
  • Two-finger gesture (3 fingers, 3 taps)

Shake is usually disabled in production or made optional via developer settings—so regular users don't accidentally open the form.

Ready-Made Tools

Tool Platforms Features
Instabug iOS, Android, Flutter, RN Shake + screen recording, Jira/Slack integrations
Shake.io iOS, Android Built-in discussion thread model
BugShaker iOS (open source) Simple, email-only
Custom implementation Any Full control, no external dependencies

Instabug is the industry standard for mobile QA teams. Custom implementation is justified if you need to control what data leaves the device.

Timeline Estimates

Custom shake detector implementation with screenshot capture and Jira submission—3–5 days. Instabug integration with custom theme and report routing configuration—1–2 days.