NativeScript / NativeScript/nativescript-cli

Karma can't access host on android emulator

Open
#2,316 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug unit testing
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

When running the unit test runner on a build slave, which has restricted internet access, the android emulator can't connect to the host machine through the external host ip address.

By doing some research i found out that the android emulator can connect to the host through a special ip, see http://stackoverflow.com/questions/8191192/reaching-a-network-device-by-ip-and-port-using-the-android-emulator.

The following solution worked for me:
https://github.com/NativeScript/nativescript-cli/compare/master...Essent:feature/proxy-2.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked NativeScript CLI comparison and the Android emulator host-networking references. Verify the unit test runner on a restricted build slave, and consider the issue done when the emulator can reach the host without relying on the external host IP.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
cli, mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.