简体   繁体   中英

log into Facebook app using am start commands/ADB shell

I would like to log into the Facebook app from an android shell using am start commands.

     am start -n com.facebook.katana/.LoginActivity

That command brings up the facebook login screen. But how do I fill out the email and password fields and submit it as a one line command from android shell?

I've tried the following....

     am start -n com.facebook.katana/.LoginActivity -e email my@email.com -e password mypassword

To no avail, I probably don't understand the usage of extras correctly though.

Additionally, If i'm already logged in these commands work perfectly

     am start -a android.intent.action.VIEW -d fb://notifications
     am start -a android.intent.action.VIEW -d fb://messages
     am start -a android.intent.action.VIEW -d fb://events

But I would like to allow multiple people to access their Facebook accounts using my process.

I don't think you can log in by passing username/pw extras to the Fb LoginActivity.

Take a look at the source code for the LoginActivity, it does not handle extra parameters passed to it for authentication.

https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/LoginActivity.java

The Fb docs do not document the behavior you are asking about either.

https://developers.facebook.com/docs/reference/android/3.0/LoginActivity/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM