Creating a .sh script to ADB Install a few APKs












0















I'm trying to make a script to install a few APKs using my Raspberry Pi. I can make a .bat that works fine on Windows, but I'm having an issue with Linux.



Here's my current script sample



#!/user/bin/X11 (location of where ADB is)
adb kill-server
adb remount
@ECHO Now installing 1
adb install /home/pi/Desktop/1.apk
@ECHO Now installing 2
adb install /home/pi/Desktop/2.apk
@ECHO Now installing 3
adb install /home/pi/Desktop/3.apk
pause


When I run the script, terminal pops up but does nothing. I did use chmod a+x on the .sh file.



Updated on the script with BASH syntax. Same issue.



#!/bin/bash
adb kill-server
adb remount
echo "Now installing 1"
adb install /home/pi/Desktop/1.apk
echo "Now installing 2"
adb install /home/pi/Desktop/2.apk
echo "Now installing 3"
adb install /home/pi/Desktop/3.apk
read









share|improve this question




















  • 2





    Yeah, because that's batch syntax. You need to use BASH syntax.

    – TheWanderer
    Nov 26 '18 at 18:50











  • I'm still learning Linux. I adjusted with the Bash syntax. Same issue. I'll update my post with the new adjustment.

    – PaliHustlaOD
    Nov 26 '18 at 19:16













  • Are you actually using #1 or is that a typo? You should also run scripts by executing them from a terminal that's already running.

    – TheWanderer
    Nov 26 '18 at 19:23











  • 1. Are you using Raspbian or another OS? 2. Where is your adb and how did you install it? Try typing which adb in a terminal. This may be a PATH issue

    – Lev M.
    Nov 26 '18 at 19:25











  • #1 was a typo. I'm trying to make this a double click the script and it'll perform the commands. I'm using Raspbian. ADB was installed via terminal. sudo apt-get update sudo apt-get install -y android-tools-adb android-tools-fastboot If I open terminal and type adb install /path/1.apk, it'll install the apk fine.

    – PaliHustlaOD
    Nov 26 '18 at 19:57


















0















I'm trying to make a script to install a few APKs using my Raspberry Pi. I can make a .bat that works fine on Windows, but I'm having an issue with Linux.



Here's my current script sample



#!/user/bin/X11 (location of where ADB is)
adb kill-server
adb remount
@ECHO Now installing 1
adb install /home/pi/Desktop/1.apk
@ECHO Now installing 2
adb install /home/pi/Desktop/2.apk
@ECHO Now installing 3
adb install /home/pi/Desktop/3.apk
pause


When I run the script, terminal pops up but does nothing. I did use chmod a+x on the .sh file.



Updated on the script with BASH syntax. Same issue.



#!/bin/bash
adb kill-server
adb remount
echo "Now installing 1"
adb install /home/pi/Desktop/1.apk
echo "Now installing 2"
adb install /home/pi/Desktop/2.apk
echo "Now installing 3"
adb install /home/pi/Desktop/3.apk
read









share|improve this question




















  • 2





    Yeah, because that's batch syntax. You need to use BASH syntax.

    – TheWanderer
    Nov 26 '18 at 18:50











  • I'm still learning Linux. I adjusted with the Bash syntax. Same issue. I'll update my post with the new adjustment.

    – PaliHustlaOD
    Nov 26 '18 at 19:16













  • Are you actually using #1 or is that a typo? You should also run scripts by executing them from a terminal that's already running.

    – TheWanderer
    Nov 26 '18 at 19:23











  • 1. Are you using Raspbian or another OS? 2. Where is your adb and how did you install it? Try typing which adb in a terminal. This may be a PATH issue

    – Lev M.
    Nov 26 '18 at 19:25











  • #1 was a typo. I'm trying to make this a double click the script and it'll perform the commands. I'm using Raspbian. ADB was installed via terminal. sudo apt-get update sudo apt-get install -y android-tools-adb android-tools-fastboot If I open terminal and type adb install /path/1.apk, it'll install the apk fine.

    – PaliHustlaOD
    Nov 26 '18 at 19:57
















0












0








0








I'm trying to make a script to install a few APKs using my Raspberry Pi. I can make a .bat that works fine on Windows, but I'm having an issue with Linux.



Here's my current script sample



#!/user/bin/X11 (location of where ADB is)
adb kill-server
adb remount
@ECHO Now installing 1
adb install /home/pi/Desktop/1.apk
@ECHO Now installing 2
adb install /home/pi/Desktop/2.apk
@ECHO Now installing 3
adb install /home/pi/Desktop/3.apk
pause


When I run the script, terminal pops up but does nothing. I did use chmod a+x on the .sh file.



Updated on the script with BASH syntax. Same issue.



#!/bin/bash
adb kill-server
adb remount
echo "Now installing 1"
adb install /home/pi/Desktop/1.apk
echo "Now installing 2"
adb install /home/pi/Desktop/2.apk
echo "Now installing 3"
adb install /home/pi/Desktop/3.apk
read









share|improve this question
















I'm trying to make a script to install a few APKs using my Raspberry Pi. I can make a .bat that works fine on Windows, but I'm having an issue with Linux.



Here's my current script sample



#!/user/bin/X11 (location of where ADB is)
adb kill-server
adb remount
@ECHO Now installing 1
adb install /home/pi/Desktop/1.apk
@ECHO Now installing 2
adb install /home/pi/Desktop/2.apk
@ECHO Now installing 3
adb install /home/pi/Desktop/3.apk
pause


When I run the script, terminal pops up but does nothing. I did use chmod a+x on the .sh file.



Updated on the script with BASH syntax. Same issue.



#!/bin/bash
adb kill-server
adb remount
echo "Now installing 1"
adb install /home/pi/Desktop/1.apk
echo "Now installing 2"
adb install /home/pi/Desktop/2.apk
echo "Now installing 3"
adb install /home/pi/Desktop/3.apk
read






android adb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 19:59







PaliHustlaOD

















asked Nov 26 '18 at 18:38









PaliHustlaODPaliHustlaOD

11




11








  • 2





    Yeah, because that's batch syntax. You need to use BASH syntax.

    – TheWanderer
    Nov 26 '18 at 18:50











  • I'm still learning Linux. I adjusted with the Bash syntax. Same issue. I'll update my post with the new adjustment.

    – PaliHustlaOD
    Nov 26 '18 at 19:16













  • Are you actually using #1 or is that a typo? You should also run scripts by executing them from a terminal that's already running.

    – TheWanderer
    Nov 26 '18 at 19:23











  • 1. Are you using Raspbian or another OS? 2. Where is your adb and how did you install it? Try typing which adb in a terminal. This may be a PATH issue

    – Lev M.
    Nov 26 '18 at 19:25











  • #1 was a typo. I'm trying to make this a double click the script and it'll perform the commands. I'm using Raspbian. ADB was installed via terminal. sudo apt-get update sudo apt-get install -y android-tools-adb android-tools-fastboot If I open terminal and type adb install /path/1.apk, it'll install the apk fine.

    – PaliHustlaOD
    Nov 26 '18 at 19:57
















  • 2





    Yeah, because that's batch syntax. You need to use BASH syntax.

    – TheWanderer
    Nov 26 '18 at 18:50











  • I'm still learning Linux. I adjusted with the Bash syntax. Same issue. I'll update my post with the new adjustment.

    – PaliHustlaOD
    Nov 26 '18 at 19:16













  • Are you actually using #1 or is that a typo? You should also run scripts by executing them from a terminal that's already running.

    – TheWanderer
    Nov 26 '18 at 19:23











  • 1. Are you using Raspbian or another OS? 2. Where is your adb and how did you install it? Try typing which adb in a terminal. This may be a PATH issue

    – Lev M.
    Nov 26 '18 at 19:25











  • #1 was a typo. I'm trying to make this a double click the script and it'll perform the commands. I'm using Raspbian. ADB was installed via terminal. sudo apt-get update sudo apt-get install -y android-tools-adb android-tools-fastboot If I open terminal and type adb install /path/1.apk, it'll install the apk fine.

    – PaliHustlaOD
    Nov 26 '18 at 19:57










2




2





Yeah, because that's batch syntax. You need to use BASH syntax.

– TheWanderer
Nov 26 '18 at 18:50





Yeah, because that's batch syntax. You need to use BASH syntax.

– TheWanderer
Nov 26 '18 at 18:50













I'm still learning Linux. I adjusted with the Bash syntax. Same issue. I'll update my post with the new adjustment.

– PaliHustlaOD
Nov 26 '18 at 19:16







I'm still learning Linux. I adjusted with the Bash syntax. Same issue. I'll update my post with the new adjustment.

– PaliHustlaOD
Nov 26 '18 at 19:16















Are you actually using #1 or is that a typo? You should also run scripts by executing them from a terminal that's already running.

– TheWanderer
Nov 26 '18 at 19:23





Are you actually using #1 or is that a typo? You should also run scripts by executing them from a terminal that's already running.

– TheWanderer
Nov 26 '18 at 19:23













1. Are you using Raspbian or another OS? 2. Where is your adb and how did you install it? Try typing which adb in a terminal. This may be a PATH issue

– Lev M.
Nov 26 '18 at 19:25





1. Are you using Raspbian or another OS? 2. Where is your adb and how did you install it? Try typing which adb in a terminal. This may be a PATH issue

– Lev M.
Nov 26 '18 at 19:25













#1 was a typo. I'm trying to make this a double click the script and it'll perform the commands. I'm using Raspbian. ADB was installed via terminal. sudo apt-get update sudo apt-get install -y android-tools-adb android-tools-fastboot If I open terminal and type adb install /path/1.apk, it'll install the apk fine.

– PaliHustlaOD
Nov 26 '18 at 19:57







#1 was a typo. I'm trying to make this a double click the script and it'll perform the commands. I'm using Raspbian. ADB was installed via terminal. sudo apt-get update sudo apt-get install -y android-tools-adb android-tools-fastboot If I open terminal and type adb install /path/1.apk, it'll install the apk fine.

– PaliHustlaOD
Nov 26 '18 at 19:57














1 Answer
1






active

oldest

votes


















0














You can also use below command for install few apks at once:




adb install-multiple







share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53487138%2fcreating-a-sh-script-to-adb-install-a-few-apks%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can also use below command for install few apks at once:




    adb install-multiple







    share|improve this answer




























      0














      You can also use below command for install few apks at once:




      adb install-multiple







      share|improve this answer


























        0












        0








        0







        You can also use below command for install few apks at once:




        adb install-multiple







        share|improve this answer













        You can also use below command for install few apks at once:




        adb install-multiple








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 1 '18 at 3:04









        wusemanwuseman

        1196




        1196
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53487138%2fcreating-a-sh-script-to-adb-install-a-few-apks%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)