Automate Blackberry 10 simulator actions
Asked Answered
S

2

13

I'm using the VMWare Player and the Blackberry 10 simulator image; I need to do some unit/integration tests automatically. I know I can use the VIX api to spin up a new Simulator and load the Blackberry image.

What I would love to be able to do is send 'key presses', launch specific apps, and perhaps send gestures. On android there's monkeyrunner and other similar apps. However I haven't found much with respect to BB10, I know it's new but I can't be the only one with this request.

Also, how powerful is the telnet option? I can telnet into an emulator and change directory into the apps dir, but I can't list its contents, SUDO, or run anything.

*****UPDATE*******

I've made some progress WRT to this, but not much. It seems that you can use the Windows API to send mouse_evt messages to the VMWare emulator; it's not 100% reliable but works enough to open apps. The big hole I have right now is being able to detect state after the action/swipe/touch is executed, aka "did the swipe I just execute work? Are we in the right app?". It would be hugely beneficial to query the device's process list, but the 'devuser' account given in the telnet example can't really do anything.

This gist has the basics for how to touch and swipe the screen based on my experiences. https://gist.github.com/edgiardina/6188074

Schelling answered 31/7, 2013 at 20:30 Comment(2)
There a new Automatic Input Control permission has been added in the recent 10.2 SDK supposedly allowing to inject touchscreen and keypad style events into the screen window though I'm struggling to find any documentation on thisRayborn
Sunseeker, I can't find anything either. It's probably a matter of waiting it out :/Schelling
S
1

As you are on windows, have you tried Autohotkey (freeware) on the host machine that runs the VMWare Player? This software can send any key/mouse move/click combination and has several ways of analysing the VMWare Player Window output and react to it.

If in your example you want to check if a certain app has started and is visible, you can start it manually once and make a screenshot of a small part of the apps interface. Then you write a script that sends whatever mouse moves and key types are needed to start the app, make the script pause a while and then perform the ImageSearch command to search for this image on screen.

Sublimity answered 14/8, 2013 at 16:56 Comment(0)
A
0

I don't know much about any of this but telnet.

When you telnet in, you're assigned a shell, which, if the shell is a restricted shell, will prevent you from doing exactly the things that you mentioned, are you able to change the default shell options for the devuser?

You can change the directory but not create files, list files anywhere but the home directory, see any of the filesystem, redirect output, set environment variables, etc.

Which shell does it give you?

Can you telnet as a different user? Create a new user with better privileges?

Dru

Srry, should be comment.

Astronavigation answered 15/8, 2013 at 8:50 Comment(1)
You can pull the simulator down yourself and follow the BB instructions on their website to see yourself. I've found instructions on rooting the device, which is great, but you still can't spawn a BB 'Card' app from the command line.Schelling

© 2022 - 2024 — McMap. All rights reserved.