Search Unity

for installing apk

Discussion in 'Scripting' started by Hippiecode, Sep 2, 2014.

  1. Hippiecode

    Hippiecode

    Joined:
    Feb 13, 2012
    Posts:
    110
    I want to install mystuff.apk,i wrote like this in start() function,but my apk is not installing.Help me out from this problem...
    void Start()
    {
    System.Diagnostics.Process p = new System.Diagnostics.Process();
    p.StartInfo.FileName = "adb";
    p.StartInfo.Arguments = string.Format("install -r {0}","mystuff.apk");
    p.Start();
    p.WaitForExit();
    }
     
  2. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    1. Is adb in your system path (ie can you open a cmd prompt and run it without changing the path)
    2. Have you installed any apk files to your device using adb previously
     
  3. Skyriot

    Skyriot

    Joined:
    Sep 3, 2014
    Posts:
    10
    What is the error you're getting on (failed) install?
     
  4. Hippiecode

    Hippiecode

    Joined:
    Feb 13, 2012
    Posts:
    110
    hi guys..
    i want to install one application through another application in android device.what is the process for that(for example i build mystuff1.apk when i run dis application after few seconds automatically mtstuff2 also will install..).