This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

Is there a way to run a system command from script? I found OS.execute() but I didn't figure out how to use it.
How I can use it to open Facebook app on Android and on iOS?

in Engine by (675 points)

1 Answer

0 votes
Best answer

You could theoretically use the OS.execute() command to run application on Android by am start -n com.example.project/.ExampleActivity but its not a good thing to do, because you would need to specify the package name and activity name which could be changed at any time and it would not work again... If you want to do it for "share" function, best thing you can do is write module with some android share library (like this one) and call it from GDscript that way...

by (85 points)
selected by

Thanks for info. For now I solve this with OS.shell_open("http://...."), which open the site in browser. Not the best solution, but better than nothing.

No problemo :) ...better than nothing i guess :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.