# Setting up Android environment with Selendroid

**URL:** <https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931>\
**Category:** Support\
**Created:** [October 17, 2014, 8:14pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931 "2014-10-17T20:14:22Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![LulzAugusto](https://discuss.appium.io/user_avatar/discuss.appium.io/lulzaugusto/32/5310_2.png) [@LulzAugusto](https://discuss.appium.io/u/LulzAugusto)\
**Post date:** [October 17, 2014, 8:14pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/1 "2014-10-17T20:14:22Z")

</div>

Hello.

I’m trying to set up this enviroment and when I click on Launch the Appium shows the following message:

```
<uses-permission android:name="android.**permission.INTERNET"/>
erro total
error: Could not pre-launch appium: Error: apk does not have INTERNET permissions. Selendroid needs internet permission to proceed, please check if you have <uses-permission android:name="android.**permission.INTERNET"/> in your AndroidManifest.xml

```

Here’s my configuration:  
 ![](https://discuss.appium.io/uploads/default/281/8d1a0371ae6a85b1.png)

I’ve already checked my AndroidManifest.xml and I have this permission on it (detail here is that I use android.permission.INTERNET, without \*\*).

I’ll appreciate any help given. Thanks!

---

<div class="post-metadata">

**Author:** ![jonahss](https://discuss.appium.io/user_avatar/discuss.appium.io/jonahss/32/5340_2.png) [@jonahss](https://discuss.appium.io/u/jonahss)\
**Post date:** [October 17, 2014, 10:32pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/2 "2014-10-17T22:32:01Z")

</div>

Hmm, you shouldn’t have to do anything special. Are you using appium, and a related appium client? What do your desired capabilities look like?

---

<div class="post-metadata">

**Author:** ![LulzAugusto](https://discuss.appium.io/user_avatar/discuss.appium.io/lulzaugusto/32/5310_2.png) [@LulzAugusto](https://discuss.appium.io/u/LulzAugusto)\
**Post date:** [October 20, 2014, 11:35am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/3 "2014-10-20T11:35:03Z")

</div>

I don’t know if I understand your first question, but yes, I’m using Appium client. And actually I don’t have desired capabilities yet, cause I can’t even Launch the server and start the emulator.

---

<div class="post-metadata">

**Author:** ![tiwanaku](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@tiwanaku](https://discuss.appium.io/u/tiwanaku)\
**Post date:** [October 20, 2014, 12:49pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/4 "2014-10-20T12:49:50Z")

</div>

I’m seeing the same error starting today. Tried appium 1.2.3, 1.2.4 and 1.3 beta. The apk is not a problem - i believe something messed up during either

- my upgrade from Maverics to Yosemite, or
- updating command line tools to 6.1, or
- updating android sdk tools

Do you have any insights?  
Thanks!

---

<div class="post-metadata">

**Author:** ![LulzAugusto](https://discuss.appium.io/user_avatar/discuss.appium.io/lulzaugusto/32/5310_2.png) [@LulzAugusto](https://discuss.appium.io/u/LulzAugusto)\
**Post date:** [October 20, 2014, 12:58pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/5 "2014-10-20T12:58:10Z")

</div>

Hmmm.  
I’m using Mavericks.

---

<div class="post-metadata">

**Author:** ![tiwanaku](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@tiwanaku](https://discuss.appium.io/u/tiwanaku)\
**Post date:** [October 21, 2014, 11:07am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/6 "2014-10-21T11:07:45Z")

</div>

We did a bit of investigation while using the same APK file.  
All works with this setup: Maverics + Appium 1.2.4  
Fails on Internet permission with: Yosemite + 1.2.4 (newer commandline tools as well)

Any clues? Our manifest includes the Internet permission.

---

<div class="post-metadata">

**Author:** ![tiwanaku](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@tiwanaku](https://discuss.appium.io/u/tiwanaku)\
**Post date:** [October 21, 2014, 11:26am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/7 "2014-10-21T11:26:17Z")

</div>

This is what we’re posting:

info: --\> POST /wd/hub/session {“desiredCapabilities”:{“automationName”:“selendroid”,“app”:"/Users/tiwanaku/Downloads/\_mob/ConcurMobile-debug.apk",“platformName”:“android”,“deviceName”:“selendroid”,“browserName”:"",“app-package”:“com.concur.breeze”,“app-activity”:“com.concur.mobile.corp.activity.Startup”}}  
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : app-package, app-activity  
info: [debug] No appActivity desired capability or server param. Parsing from apk.  
info: [debug] No appPackage desired capability or server param. Parsing from apk.  
info: [debug] Using local app from desired caps: /Users/tiwanaku/Downloads/\_mob/ConcurMobile-debug.apk

---

<div class="post-metadata">

**Author:** ![jonahss](https://discuss.appium.io/user_avatar/discuss.appium.io/jonahss/32/5340_2.png) [@jonahss](https://discuss.appium.io/u/jonahss)\
**Post date:** [October 21, 2014, 9:29pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/8 "2014-10-21T21:29:10Z")

</div>

You want to use `appActivity` and `appPackage`. Camelcase not hyphenated.

Commandline tools 6.1 should be fine. Yosemite shouldn’t bother it either.

---

<div class="post-metadata">

**Author:** ![tiwanaku](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@tiwanaku](https://discuss.appium.io/u/tiwanaku)\
**Post date:** [October 22, 2014, 6:08am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/9 "2014-10-22T06:08:44Z")

</div>

Okey, we will fix that. However - the root was elsewhere: android sdk, build tools version 21. All works just fine with version 20.

---

<div class="post-metadata">

**Author:** ![postalPain](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/e9a140/32.png) [@postalPain](https://discuss.appium.io/u/postalPain)\
**Post date:** [October 29, 2014, 8:42am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/10 "2014-10-29T08:42:58Z")

</div>

Have the same issue.  
Appium 1.3.1  
OS X 10.9.4  
SDK 10/19/20/21

---

<div class="post-metadata">

**Author:** ![Aki](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Aki](https://discuss.appium.io/u/Aki)\
**Post date:** [October 31, 2014, 11:24am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/11 "2014-10-31T11:24:06Z")

</div>

Same issue. All works perfect for Appium automationName and crashes with Selendroid…  
Any solution?

Appium 1.2.3, OSX 10.10

---

<div class="post-metadata">

**Author:** ![Massanori\_Takaki](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Massanori\_Takaki](https://discuss.appium.io/u/Massanori_Takaki)\
**Post date:** [October 31, 2014, 5:37pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/12 "2014-10-31T17:37:22Z")

</div>

I noticed the same problem here in my machine, and the RegExp whtin adb.js is not working for aapt 21.0.2 (My version).  
Here when I run the same command the value for INTERNET permission is:  
uses-permission: **name=** ‘android.permission.INTERNET’  
but the regex in adb.js is uses-permission:‘android.permission.INTERNET’.  
So what you can do is edit the file adb.js in …/appium/node\_modules/appium-adb/lib/adb.js  
Method ADB.prototype.hasInternetPermissionFromManifest look for **var hasInternetPermission = new RegExp**  
and change the value for **“uses-permission: name=‘android.permission.INTERNET’”**.  
After changing the regex, it worked for me.

---

<div class="post-metadata">

**Author:** ![Aki](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Aki](https://discuss.appium.io/u/Aki)\
**Post date:** [November 1, 2014, 8:05am UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/13 "2014-11-01T08:05:31Z")

</div>

Massanori\_Takaki, many thanks! That worked for me.  
Just in case, the full path to adb.js for mac users (appium installed from npm):  
/usr/local/lib/node\_modules/appium/node\_modules/appium-adb/lib/

Also I sent the bug report: [https://github.com/appium/appium-adb/issues/58](https://github.com/appium/appium-adb/issues/58) in case if it’s bug )

---

<div class="post-metadata">

**Author:** ![Ernest](https://discuss.appium.io/letter_avatar_proxy/v4/letter/e/c67d28/32.png) [@Ernest](https://discuss.appium.io/u/Ernest)\
**Post date:** [November 19, 2014, 3:26pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/14 "2014-11-19T15:26:16Z")

</div>

How do I edit this file on Windows. If I use Notepad to edit adb.js, javascript tells me that there is an error on line 3. I then have to reinstall appium to recover from the second error.

---

<div class="post-metadata">

**Author:** ![Massanori\_Takaki](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Massanori\_Takaki](https://discuss.appium.io/u/Massanori_Takaki)\
**Post date:** [November 19, 2014, 4:00pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/15 "2014-11-19T16:00:39Z")

</div>

Hi @Ernest,  
Try to use Notepad++ instead of Notepad, and look for that string.

---

<div class="post-metadata">

**Author:** ![Ernest](https://discuss.appium.io/letter_avatar_proxy/v4/letter/e/c67d28/32.png) [@Ernest](https://discuss.appium.io/u/Ernest)\
**Post date:** [November 19, 2014, 10:40pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/16 "2014-11-19T22:40:52Z")

</div>

That works. Thank you.

---

<div class="post-metadata">

**Author:** ![SamClayton](https://discuss.appium.io/user_avatar/discuss.appium.io/samclayton/32/5281_2.png) [@SamClayton](https://discuss.appium.io/u/SamClayton)\
**Post date:** [December 2, 2014, 9:35pm UTC](https://discuss.appium.io/t/setting-up-android-environment-with-selendroid/931/17 "2014-12-02T21:35:38Z")

</div>

I’m seeing this same behavior with the Appium 1.3.3 desktop app binary on OS X 10.9.5. If I downgrade the Android Build Tools package to version 20, everything works fine.
