No need to sudo to get the right environment over adb shell
commitf6216636de9a1c4bb7a68bf3f80115d3536faa83
authorMichał Sawicz <michal.sawicz@canonical.com>
dateMon 8 Sep 2014, 15:11 (12 years ago)
parentff1b2bc
tools/unlock-device+1−1
@@ -24,7 +24,7 @@ eval "$WAIT_COMMAND"
2424sleep 30
2525
2626# We need to go through sudo to get a proper environment for dbus set up
27−UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i gdbus call --session --dest com.canonical.UnityGreeter --object-path / --method com.canonical.UnityGreeter.HideGreeter && echo Greeter unlocked" 2>&1)
27+UNLOCK_OUTPUT=$(adb shell "gdbus call --session --dest com.canonical.UnityGreeter --object-path / --method com.canonical.UnityGreeter.HideGreeter && echo Greeter unlocked" 2>&1)
2828if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
2929 echo "I: Unlock passed"
3030 exit 0