Jump to content
cagatay

How to Autorun an App at Startup

Recommended Posts

Hi,

We have developed a game with Unity 3D, and put into Tinker board 2/4G that runs Android 11 and we would like to make our game automatically run at startup. We could not find out how to make it autorun. In application settings / all permissions window, I see a permission called "Run at Startup", but there is no switch to make it on/off. How can we put an app on startup in Android 11?

Best regards

Cagatay Undeger

Share this post


Link to post
Share on other sites

In my case I created a launcher app in AndroidStudio and replaced it,  and called it in onPostCreate() as follows to call a target app at startup.

private void launchApp() {
     String packageName = "com.mycompany.title";
     String className = "com.unity3d.player.UnityPlayerActivity";
     Intent intent = new Intent();
     intent.setAction(Intent.ACTION_VIEW);
     intent.setClassName(packageName, className);
     startActivity(intent);
}

Share this post


Link to post
Share on other sites
On 1/19/2023 at 3:41 PM, jamesbro said:

Hi,

This is a simple step to resolve you solution which i read from Zuckerberg Games so 1st of all you Press Windows logo key + R, type shell:startup, and then click OK while the file location is open. The Startup folder is now visible. The shortcut to the app should be copied and pasted into the Startup folder from the file location.

 

Share this post


Link to post
Share on other sites

Hi, you can simply try that on .bashrc

1. open sudo nano /home/linaro/.bashrc 

2. Just go down and add your executable r python file like this 

3. Press ctrl+o to write and exit using ctrl+x 

4.Now click new terminal it will run.

Eg. 

./filename (for exe) &

python3 script.py &

Edited by sathish

Share this post


Link to post
Share on other sites

The process for autorunning an app at startup varies depending on your operating system. Here are some general steps for the most common operating systems:

Windows:

  1. Press the Windows key + R to open the Run dialog box.
  2. Type "shell:startup" and press Enter. This will open the Startup folder for your user account.
  3. Right-click in the folder and select "New" > "Shortcut".
  4. In the "Create Shortcut" dialog box, browse to the location of the app  of Funciones de Cálculo you want to autorun and click "Next".
  5. Enter a name for the shortcut and click "Finish".
  6. The shortcut should now appear in the Startup folder. The app will run automatically when you log in to your user account.

macOS:

  1. Open System Preferences and click "Users & Groups".
  2. Click the lock icon in the bottom left corner and enter your admin username and password.
  3. Click the "+" button under "Login Items".
  4. Browse to the location of the app you want to autorun and select it.
  5. The app will now run automatically when you log in to your user account.

Linux:

  1. Open your distribution's Startup Applications manager.
  2. Click the "+" or "Add" button to add a new startup application.
  3. Enter a name for the app and browse to its location.
  4. The app will now run automatically when you log in to your user account.

Note that the exact steps may vary depending on your specific operating system and version. If you have trouble autorunning an app at startup, you may want to search for specific instructions for your operating system or consult with your system administrator.

Share this post


Link to post
Share on other sites

Hello there,

For my situation, I developed a launcher application using AndroidStudio and replaced it with the existing one. To initiate the target application upon startup, I utilized the following code within the onPostCreate() method:


 
javaCopy code
private void launchApp() { String packageName = "com.mycompany.title"; String className = "com.unity3d.player.UnityPlayerActivity"; Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setClassName(packageName, className); startActivity(intent); }

This code snippet ensures that the desired application, identified by the specified package name and class name, is called and launched appropriately.

Regards

Devid Lucas 

Share this post


Link to post
Share on other sites

To autorun an app at startup, you can follow these steps:

1. On Windows: Open the "Task Manager" by pressing Ctrl+Shift+Esc, go to the "Startup" tab, and click "Open Task Manager." Right-click on the app you want to autorun and select "Enable."

2. On macOS: Go to "System Preferences," click on "Users & Groups," select your username, and go to the "Login Items" tab. Click the "+" button, locate the app you want to autorun, and add it to the list.

3. On Android: The process may vary depending on the device and Android version. In general, you can go to the "Settings" menu, search for "Autostart" or "Startup Apps," and enable the option for the desired app to autorun at startup.

4. On iOS: Unfortunately, iOS does not provide a built-in feature to autorun apps at startup. Apple restricts this functionality for security and performance reasons.

Please note that autorunning apps at startup should be done judiciously to avoid excessive resource usage or potential security risks. Always consider the impact on device performance and privacy when enabling autorun for apps.

Share this post


Link to post
Share on other sites

Autorunning an app at startup can be done in several ways depending on your operating system. Here are the general steps for some common platforms:

Windows:

  1. Startup Folder:

    • Press Win + R to open the Run dialog box.
    • Type shell:startup and hit Enter. This opens the Startup folder.
    • Copy a shortcut of the application into this folder.
  2. Task Scheduler:

    • Search for "Task Scheduler" in the Start menu and open it.
    • Click on "Create Basic Task" from the right-hand menu.
    • Follow the wizard to set a name, trigger (choose "When the computer starts"), action (select "Start a program"), and browse to select the application's executable file.

macOS:

  1. Login Items:

    • Go to System Preferences > Users & Groups.
    • Click on your username and go to the "Login Items" tab.
    • Click the "+" button and add the application to the list.
  2. Launch Agents:

    • Create a .plist file in /Library/LaunchAgents or ~/Library/LaunchAgents (for a specific user).
    • Set the ProgramArguments key to the path of the application executable.

Linux (Ubuntu):

  1. Startup Applications:

    • Go to "Startup Applications" or search for it in the application menu.
    • Click "Add" or "New" and add the application with its command or path.
  2. rc.local:

    • Edit the /etc/rc.local file and add a line to start the application before the exit 0 line.

Note:

  • Ensure you have the necessary permissions to modify system startup settings.
  • Always be cautious about what applications you set to autorun for security and performance reasons.

Choose the method that best suits your preferences and system requirements.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...