3 Replies Latest reply on Sep 15, 2016 6:31 AM by kerrishotts

    How to emulate Phonegap Application without a network connection to android physical device

    jakec86659707 Level 1

      Please help me with my problem guys.

       

      I'm new to phonegap development.

      I want to know how to emulate the created application using phonegap desktop (NOT CLI) directly to the physical android device WITHOUT setting up a network. I want to use USB connector that connects the PC and my phone.

       

      Is there any way to do this just like using the USB debugging?

      Im using Windows 7 operating system and the Phonegap desktop version not the CLI.

       

       

      Your help will be highly appreciated. Thank you.

        • 1. Re: How to emulate Phonegap Application without a network connection to android physical device
          kerrishotts Adobe Community Professional

          You might try adb: Android Debug Bridge | Android Studio

           

          Don't know if that will do what you want it to or not. Is there a particular reason you're trying to avoid a network connection?

          • 2. Re: How to emulate Phonegap Application without a network connection to android physical device
            jakec86659707 Level 1

            Thanks for your reply.

            Because i dont have a wifi in our home. so I did, i created a hotspot in my phone in order my pc can connect to that netwok. I dont want that. I like something like eclipse that you connect your pc through USB debugging. Is USB debugging possible to use for the emulator in phone gap.?

             

            Can you show me some tutorial or step to setup Android debug bride and android studio. I already have android studio but i jst dont how to use in for phonegap.

             

            Or which is better between the two to achieve efficiency and speed.?

            • 3. Re: How to emulate Phonegap Application without a network connection to android physical device
              kerrishotts Adobe Community Professional

              You can always create an adhoc WiFi connection from your development machine. Your android devices can then join that network. This will likely limit their access to the Internet, so that's something to be aware of.

               

              If you already have Android Studio installed, then you're 90% of the way to using the PhoneGap CLI. That would be my suggestion. It can deploy built apps over USB with no problem. The PhoneGap Desktop app, however, CAN NOT DEPLOY APPS TO DEVICES OR EMULATORS.

               

              In order to do so, you need to properly configure your environment. Not knowing your operating system means that I can't tailor this to your environment, so you'll need to extrapolate as necessary:

               

              1. Obtain the Android SDK path from Android Studio.

              2. Edit your environment to export a modified path of the form (If you use Windows, this would be done differently):

               

                  export PATH="${PATH}:/path/to/Android/Sdk/tools:/path/to/Android/Sdk/platform-tools"

               

              3. You should now be able to use Android's command-line tools. To test, try running "android" and see if the SDK manager pops up. You can use "android avd" to manage Android emulators. You should also be able to use "adb".

               

              4. Install the PhoneGap CLI:

               

                  a. Install Node.js (I suggest using nvm on *nix systems and using nvm-windows on Windows)

                  b. Install Phonegap CLI (npm install -g phonegap)

               

              5. Deploy your app to the attached device

               

                 phonegap run android

               

              6. Debug using Chrome (chrome://inspect), assuming USB debugging is enabled on your device