The proof of concept works well if the device has swip only lock policy. But if there is a passcode or passphrase then the problem might be more complicated.
In the UITK test plan executor [1] I use this to unlock the screen, keep it locked and shiny: adb -s ${SERIALNUMBER} shell powerd-cli display on |egrep -v "Display State requested, cookie is|Press ctrl-c to exit|not fully supported." & adb -s ${SERIALNUMBER} shell powerd-cli active |egrep -v "requested, cookie is|Press ctrl-c to exit|not fully supported." & adb -s ${SERIALNUMBER} shell "sudo -u phablet -i gdbus call --session --dest com.canonical.UnityGreeter \ --object-path / \ --method com.canonical.UnityGreeter.HideGreeter|grep -v '\(\)'" adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S dbus-send --system --print-reply \ --dest=org.freedesktop.Accounts \ /org/freedesktop/Accounts/User32011 \ org.freedesktop.DBus.Properties.Set \ string:com.canonical.unity.AccountsService \ string:demo-edges variant:boolean:false 2>&1|grep -v password|egrep -v '\(\)|method return'" It uses '0000' password. [1] http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui- toolkit/trunk/view/head:/tests/uitk_test_plan.sh ** Changed in: ubuntu-ui-toolkit (Ubuntu) Status: New => Won't Fix ** Changed in: ubuntu-ui-toolkit Status: New => Won't Fix -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in Ubuntu. https://bugs.launchpad.net/bugs/1228061 Title: [touch]Provide a sane solution to unlock the screen on touch devices during autopilot test run Status in Ubuntu UI Toolkit: Won't Fix Status in “ubuntu-ui-toolkit” package in Ubuntu: Won't Fix Bug description: Currently autopilot tests for different apps if the screen is not unlocked, we can't do that in each of the individual apps rather a better solution is to implement a sane approach in the UItoolkit emulators. The basic idea is 1. Check if unity8 have the autopilot interface i.e. is it running in testability ==> If it is then check the status of the unity8 greeter and if its shown make sure to unlock it ==> if unity8 not running in testability mode then add a upstart override for unity8 job and restart it ==> Check the status of the greeter and unlock The advantages of this approach is the fact that we don't need to restart unity8 for every test suite we run in a session and also the fact that unity8 may not even need to be restarted even on a cold boot once the upstart override is set. ProblemType: Bug DistroRelease: Ubuntu 13.10 Package: ubuntu-ui-toolkit-autopilot 0.1.46+13.10.20130916-0ubuntu1 ProcVersionSignature: Ubuntu 3.11.0-7.13-generic 3.11.0 Uname: Linux 3.11.0-7-generic i686 NonfreeKernelModules: wl ApportVersion: 2.12.1-0ubuntu4 Architecture: i386 Date: Fri Sep 20 14:16:09 2013 InstallationDate: Installed on 2013-06-07 (104 days ago) InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha i386 (20130606.1) MarkForUpload: True PackageArchitecture: all SourcePackage: ubuntu-ui-toolkit UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1228061/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp