I use the Monkey to stress-test my app. On https://developer.android.com/studio/test/monkey.html I read:
-s <seed> Seed value for pseudo-random number generator. If you re-run the Monkey with the same seed value, it will generate the same sequence of events.
But when I ran the Monkey twice with the same seed and then compared the outputs, coordinates of my ACTION_UP and ACTION_DOWN events weren't the same.
Output #1
:Monkey: seed=1470246130093 count=50
:AllowPackage: sample1.com.sample_1
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Event percentages:
// 0: 7.5%
// 1: 5.0%
// 2: 1.0%
// 3: 7.5%
// 4: 50.0%
// 5: -0.0%
// 6: 12.5%
// 7: 7.5%
// 8: 1.0%
// 9: 1.0%
// 10: 0.5%
// 11: 6.5%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=sample1.com.sample_1/.MainActivity;end
// Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=sample1.com.sample_1/.MainActivity } in package sample1.com.sample_1
:Sending rotation degree=2, persist=true
:Sending rotation degree=3, persist=true
:Sending rotation degree=3, persist=true
:Sending rotation degree=0, persist=true
:Sending rotation degree=0, persist=true
:Sending rotation degree=1, persist=false
:Sending rotation degree=2, persist=true
:Sending rotation degree=2, persist=true
:Sending rotation degree=0, persist=true
:Sending Trackball (ACTION_MOVE): 0:(2.0,1.0)
:Sending rotation degree=2, persist=false
:Sending rotation degree=3, persist=true
:Sending rotation degree=0, persist=false
:Sending rotation degree=1, persist=false
:Sending rotation degree=0, persist=true
:Sending Touch (ACTION_DOWN): 0:(1091.0,998.0)
:Sending Touch (ACTION_UP): 0:(1106.5758,994.1529)
:Sending rotation degree=3, persist=false
:Sending Trackball (ACTION_MOVE): 0:(-2.0,3.0)
Events injected: 50
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=241ms (0ms mobile, 0ms wifi, 241ms not connected)
// Monkey finished
Output #2
:Monkey: seed=1470246130093 count=50
:AllowPackage: sample1.com.sample_1
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Event percentages:
// 0: 7.5%
// 1: 5.0%
// 2: 1.0%
// 3: 7.5%
// 4: 50.0%
// 5: -0.0%
// 6: 12.5%
// 7: 7.5%
// 8: 1.0%
// 9: 1.0%
// 10: 0.5%
// 11: 6.5%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=sample1.com.sample_1/.MainActivity;end
// Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=sample1.com.sample_1/.MainActivity } in package sample1.com.sample_1
:Sending rotation degree=2, persist=true
:Sending rotation degree=3, persist=true
:Sending rotation degree=3, persist=true
:Sending rotation degree=0, persist=true
:Sending rotation degree=0, persist=true
:Sending rotation degree=1, persist=false
:Sending rotation degree=2, persist=true
:Sending rotation degree=2, persist=true
:Sending rotation degree=0, persist=true
:Sending Trackball (ACTION_MOVE): 0:(2.0,1.0)
:Sending rotation degree=2, persist=false
:Sending rotation degree=3, persist=true
:Sending rotation degree=0, persist=false
:Sending rotation degree=1, persist=false
:Sending rotation degree=0, persist=true
:Sending Touch (ACTION_DOWN): 0:(1635.0,510.0)
:Sending Touch (ACTION_UP): 0:(1650.5758,506.1529)
:Sending rotation degree=3, persist=false
:Sending Trackball (ACTION_MOVE): 0:(-2.0,3.0)
Events injected: 50
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=428ms (0ms mobile, 0ms wifi, 428ms not connected)
// Monkey finished
Why? I expected to see the same events and, hence, the identical outputs