Issue launching app on android real device/emulator

4,124 views
Skip to first unread message

Swapna chennadi

unread,
May 10, 2013, 7:33:35 AM5/10/13
to appium-...@googlegroups.com
Hello everyone,

I am trying to test an app on android device.
The .apk gets installed successfully but appium doesn't launch it.
Appium server pauses with the following message both on real device and an emulator.

"info: [ADB] Using adb from /adt-bundle-mac-x86_64-20130219/sdk/platform-tools/adb
info: [ADB] Getting connected devices...
info: [ADB] 1 device(s) connected
info: [ADB] Waiting for device 007c7266xxxxx to be ready and to respond to shell commands
info: [ADB] Pushing appium bootstrap to device...
info: [ADB] Forwarding system:4724 to device:4724
info: [ADB] Packages found:
info: [ADB] 
info: [ADB] Installing app apk
info: [ADB] /Users/adt-bundle-mac-x86_64-20130219/sdk/platform-tools/adb -s 007c7266869691a6 install -r /Users/Test/src/test/MainActivity.apk
debug: pkg: /data/local/tmp/MainActivity.apk
Success"


Do I need to perform any other steps for the app to both install and launch?
Anyone else came across this behaviour? 

Many Thanks,
Swapna

Dan Cuellar

unread,
May 10, 2013, 9:54:24 AM5/10/13
to appium-...@googlegroups.com
You must supply the android package and the activity using the --app-package and --app-activity flags

Jonathan Lipps

unread,
May 10, 2013, 12:02:02 PM5/10/13
to Swapna chennadi, appium-...@googlegroups.com
I think the screen might need to be unlocked first on a real device right now?

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Swapna chennadi

unread,
May 10, 2013, 1:10:27 PM5/10/13
to appium-...@googlegroups.com, Swapna chennadi
I tried the suggested solutions.But no luck yet.
The screen is unlocked.
I tried giving the android package and activity name in Appium UI, but it failed with the following message .

"usage: server.js [-h] [-v] [--app APP] [-V] [-U UDID] [-a ADDRESS] [-p PORT]
                 [-k] [--fast-reset] [--no-reset] [-l] [-g LOG] [-G WEBHOOK]
                 [-w] [--without-delay] [--app-pkg ANDROIDPACKAGE]
                 [--app-activity ANDROIDACTIVITY] [--skip-install] [--safari]
                 [--force-iphone] [--force-ipad]
                

server.js: error: Unrecognized arguments: app-pkg com.example.android.effectivenavigation."


I think its expecting '--app-pkg' but from UI it's being sent as 'app-pkg'.
I have latest version 0.5.0 installed.

I tried passing in the paramters through terminal .
Appium pauses after the success message.

"$ appium --app-activity MainActivity --app-pkg com.example.android.effectivenavigation
info: Appium REST http interface listener started on 0.0.0.0:4723
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"MAC","app":"/Users/swapna.chennadi/git/qa-automation-templateproject/src/test/resources/multidevice/MainActivity.apk","browserName":"","app-package":"com.example.android.effectivenavigation","device":"android","app-activity":"MainActivity","version":"4.2"}}
info: Using local app from desiredCaps: /Users/Test/src/test/resources/multidevice/MainActivity.apk
info: Creating new appium session 752e40fb-8158-49ff-93100-93532fa16e1c
debug: Using fast reset? false
info: [ADB] Using adb from /Users//adt-bundle-mac-x86_64-20130219/sdk/platform-tools/adb

info: [ADB] Getting connected devices...
info: [ADB] 1 device(s) connected
info: [ADB] Waiting for device emulator-5554 to be ready and to respond to shell commands

info: [ADB] Pushing appium bootstrap to device...
info: [ADB] Forwarding system:4724 to device:4724
info: [ADB] Packages found:
info: [ADB]
info: [ADB] Installing app apk
info: [ADB] /Users//adt-bundle-mac-x86_64-20130219/sdk/platform-tools/adb -s emulator-5554 install -r /Users/Test/src/test/resources/multidevice/MainActivity.apk
debug:     pkg: /data/local/tmp/MainActivity.apk
Success
"



Swapna

Jonathan Lipps

unread,
May 10, 2013, 1:43:32 PM5/10/13
to Swapna chennadi, appium-...@googlegroups.com
Looks like an issue with Appium.app. You might have more luck running from source. /cc penguinho

Dan Cuellar

unread,
May 10, 2013, 3:50:35 PM5/10/13
to appium-...@googlegroups.com, Swapna chennadi
You need to re-download Appium.app from http://appium.io. I fixed this bug a couple of weeks ago. Download 1.6.4 and this issue is fixed.

Swapna chennadi

unread,
May 14, 2013, 3:55:36 AM5/14/13
to appium-...@googlegroups.com, Swapna chennadi
Hi Dan,
I have re-downloaded Appium.app 1.6.4 but still I am unable to launch the server.
Launch fails with following error message.

"error: uncaughtException date=Tue May 14 2013 08:52:27 GMT+0100 (BST), pid=44040, uid=570273391, gid=1519764623, cwd=/Applications/Appium.app/Contents/Resources/node_modules/appium, execPath=/Applications/Appium.app/Contents/Resources/node/bin/node, version=v0.10.5, argv=[/Applications/Appium.app/Contents/Resources/node/bin/node, /Applications/Appium.app/Contents/Resources/node_modules/appium/server.js, --address, 127.0.0.1, --port, 4723, --app, /Users/swapna.chennadi/git/qa-automation-templateproject/src/test/resources/multidevice/MainActivity.apk, --keep-artifacts, --quiet, --app-pkg, com.example.android.effectivenavigation, --app-activity, MainActivity], rss=31993856, heapTotal=19666944, heapUsed=13279928, loadavg=[2.17529296875, 2.083984375, 1.82275390625], uptime=319726, trace=[column=18, file=fs.js, function=Object.fs.openSync, line=427, method=fs.openSync, native=false, column=15, file=fs.js, function=Object.fs.readFileSync, line=284, method=fs.readFileSync, native=false, column=36, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/android/adb.js, function=ADB.buildFastReset, line=125, method=buildFastReset, native=false, column=12, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/android/adb.js, function=null, line=299, method=null, native=false, column=14, file=/Applications/Appium.app/Contents/Resources/node_modules/appium/android/adb.js, function=null, line=277, method=null, native=false, column=7, file=child_process.js, function=ChildProcess.exithandler, line=636, method=exithandler, native=false, column=17, file=events.js, function=ChildProcess.EventEmitter.emit, line=98, method=EventEmitter.emit, native=false, column=16, file=child_process.js, function=maybeClose, line=730, method=null, native=false, column=11, file=child_process.js, function=, line=943, method=null, native=false, column=17, file=events.js, function=Socket.EventEmitter.emit, line=95, method=EventEmitter.emit, native=false], stack=[Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/app/android/AndroidManifest.xml.src',     at Object.fs.openSync (fs.js:427:18),     at Object.fs.readFileSync (fs.js:284:15),     at ADB.buildFastReset (/Applications/Appium.app/Contents/Resources/node_modules/appium/android/adb.js:125:36),     at /Applications/Appium.app/Contents/Resources/node_modules/appium/android/adb.js:299:12,     at /Applications/Appium.app/Contents/Resources/node_modules/appium/android/adb.js:277:14,     at ChildProcess.exithandler (child_process.js:636:7),     at ChildProcess.EventEmitter.emit (events.js:98:17),     at maybeClose (child_process.js:730:16),     at Socket.<anonymous> (child_process.js:943:11),     at Socket.EventEmitter.emit (events.js:95:17)]"


Swapna

Swapna chennadi

unread,
May 14, 2013, 4:32:46 AM5/14/13
to appium-...@googlegroups.com, Swapna chennadi
Unable to run the test against appium when I launch it through Terminal.
I took latest code form git for appium.Started Appium through Terminal.Unable to run the test against it.
I tried to run test both on real android device and an emulator.
Steps followed and stack trace is as below.

git clone https://github.com/appium/appium.git
cd appium
./reset.sh
$ node server.js
info: Appium REST http interface listener started on 0.0.0.0:4723
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"MAC","app":"/Users/Test/src/test/resources/multidevice/MainActivity.apk","browserName":"","app-package":"com.example.android.effectivenavigation","device":"android","app-activity":"MainActivity","version":"4.2"}}
error: Trying to run a session for device android but that device hasn't been configured. Run config
info: Got configuration error, not starting session
error: Failed to start an Appium session, err was: Error: Device android not configured yet
info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started (Original error: Device android not configured yet)","origValue":"Device android not configured yet"},"sessionId":null}
POST /wd/hub/session 500 8ms - 225

"

Would greatly appreciate any help.


Swapna.

Jonathan Lipps

unread,
May 14, 2013, 4:40:23 AM5/14/13
to Swapna chennadi, appium-...@googlegroups.com
Please run ./reset.sh --verbose

And share a gist of the output. I don't think reset.sh is completing successfully.

Swapna chennadi

unread,
May 14, 2013, 5:04:22 AM5/14/13
to appium-...@googlegroups.com, Swapna chennadi
Jonathan,

Yes, you are right . The reset.sh did not run successfully.
Please find the log trace here
https://gist.github.com/swapna-chennadi/5574635

Jonathan Lipps

unread,
May 14, 2013, 5:40:22 AM5/14/13
to Swapna chennadi, appium-...@googlegroups.com
Seems like a problem with your build tools. Do you have latest XCode and command-line tools installed? If you don't care about iOS, you can run reset.sh like this:

./reset.sh --verbose --android

And it will ignore iOS setup.

Swapna chennadi

unread,
May 15, 2013, 6:58:30 AM5/15/13
to appium-...@googlegroups.com, Swapna chennadi
Jonathan,

I tried ./reset.sh --verbose --android.It was unable to identify the ANDROID_HOME , so I used 
sudo ANDROID_HOME="/Users/swapna.chennadi/Development/sdk"  ./reset.sh --verbose --android which worked fine.
Please find the log trace here https://gist.github.com/swapna-chennadi/5583178

But, still I am unable to run my test, as the appium server gives the following message and test fails.I tried to run on both real device and emulator.

$ appium --app-activity MainActivity --app-pkg com.example.android.effectivenavigation
info: Appium REST http interface listener started on 0.0.0.0:4723

debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"MAC","app":"/Users/swapna.chennadi/git/qa-automation-templateproject/src/test/resources/multidevice/MainActivity.apk","browserName":"","app-package":"com.example.android.effectivenavigation","device":"Android","app-activity":"MainActivity","version":"4.2"}}
error: Trying to run a session for device android but that device hasn't been configured. Run config
info: Got configuration error, not starting session
error: Failed to start an Appium session, err was: Error: Device android not configured yet
info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started (Original error: Device android not configured yet)","origValue":"Device android not configured yet"},"sessionId":null}
POST /wd/hub/session 500 9ms - 225





 

Jonathan Lipps

unread,
May 16, 2013, 1:49:36 PM5/16/13
to Swapna chennadi, appium-...@googlegroups.com
I would never run reset.sh with sudo, as it will set permissions on files incorrectly.

At this point I would delete the repo and re-clone, and then try running:

ANDROID_HOME="/Users/swapna.chennadi/Development/sdk"  ./reset.sh --verbose --android

I.e., without sudo. What happens if you try that? You might also export ANDROID_HOME in your shell startup script.


Swapna chennadi

unread,
May 17, 2013, 10:36:41 AM5/17/13
to appium-...@googlegroups.com, Swapna chennadi
There was some issue with the Android sdk bundle which I installed .The re-installation of it worked.
Thanks a lot for your help.

Shalin Shah

unread,
Jun 12, 2013, 12:42:32 PM6/12/13
to appium-...@googlegroups.com, Swapna chennadi
Hi, I was trying to execute reset.sh --ios --dev but it was failed in between.
The log is here....

undersc...@0.2.17 node_modules/underscore-cli
├── comm...@1.1.1 (keyp...@0.1.0)
├── coffee...@1.6.3
└── JSONS...@0.4.0

gr...@0.4.1 node_modules/grunt
├── wh...@1.0.5
├── datef...@1.0.2-1.2.3
├── hoo...@0.2.3
├── as...@0.1.22
├── no...@1.0.10 (abb...@1.0.4)
├── rim...@2.0.3 (grace...@1.1.14)
├── evente...@0.4.11
├── mini...@0.2.12 (sig...@1.0.0, lru-...@2.3.0)
├── coffee...@1.3.3
├── undersco...@2.2.0rc
├── iconv...@0.2.10
├── lod...@0.9.2
├── js-...@2.0.5 (esp...@1.0.3)
└── findu...@0.1.2 (lod...@1.0.1)

exp...@3.0.6 node_modules/express
├── met...@0.0.1
├── fr...@0.1.0
├── cookie-s...@0.0.1
├── range-...@0.0.4
├── buffer...@0.1.1
├── coo...@0.0.5
├── de...@0.7.2
├── comm...@0.6.1
├── mkd...@0.3.3
├── se...@0.1.0 (mi...@1.2.6)
└── con...@2.7.2 (pa...@0.0.1, by...@0.1.0, formi...@1.0.11, q...@0.5.1)

socket.i...@0.9.16 node_modules/socket.io-client
├── xmlhttp...@1.4.2
├── ugli...@1.2.5
└── active-x-...@0.0.1 (zepa...@0.0.5)

w...@0.0.32 node_modules/wd
├── va...@0.1.0
├── q...@0.9.6
└── req...@2.21.0 (json-stri...@4.0.0, foreve...@0.5.0, aws-...@0.3.0, q...@0.6.5, tunnel...@0.3.0, oauth...@0.3.0, cooki...@0.3.0, mi...@1.2.9, http-si...@0.9.11, ha...@0.13.1, form...@0.0.8)
* Setting git revision data
Running "setGitRev" task
error: uncaughtException date=Wed Jun 12 2013 22:13:19 GMT+0530 (IST), pid=1422, uid=501, gid=20, cwd=/Users/admin/Documents/appium-master, execPath=/usr/local/Cellar/node/0.10.10/bin/node, version=v0.10.10, argv=[node, /Users/admin/Documents/appium-master/node_modules/.bin/grunt, setGitRev], rss=65056768, heapTotal=57203968, heapUsed=25636288, loadavg=[1.5751953125, 1.05419921875, 0.74462890625], uptime=2231, trace=[column=15, file=child_process.js, function=ChildProcess.exithandler, line=637, method=exithandler, native=false, column=17, file=events.js, function=ChildProcess.EventEmitter.emit, line=98, method=EventEmitter.emit, native=false, column=16, file=child_process.js, function=maybeClose, line=735, method=null, native=false, column=11, file=child_process.js, function=, line=948, method=null, native=false, column=17, file=events.js, function=Socket.EventEmitter.emit, line=95, method=EventEmitter.emit, native=false, column=12, file=net.js, function=Pipe.close, line=451, method=close, native=false], stack=[Error: Command failed: fatal: Not a git repository (or any of the parent directories): .git, ,     at ChildProcess.exithandler (child_process.js:637:15),     at ChildProcess.EventEmitter.emit (events.js:98:17),     at maybeClose (child_process.js:735:16),     at Socket.<anonymous> (child_process.js:948:11),     at Socket.EventEmitter.emit (events.js:95:17),     at Pipe.close (net.js:451:12)]
---- FAILURE: reset.sh exited with status 1 ----

Shalin Shah

unread,
Jun 12, 2013, 12:47:32 PM6/12/13
to appium-...@googlegroups.com, Swapna chennadi
Also I would like to know I am getting Instrumentation failed becasue of wrong bundleID or app path randomly.
What can be the reason?
 

bootstrap online

unread,
Jun 12, 2013, 12:49:09 PM6/12/13
to Shalin Shah, appium-...@googlegroups.com, Swapna chennadi
Make sure you used git clone to download appium. "Command failed:
fatal: Not a git repository"

Jonathan Lipps

unread,
Jun 12, 2013, 12:50:32 PM6/12/13
to Shalin Shah, appium-...@googlegroups.com, Swapna chennadi
You don't need to run reset.sh if you didn't clone appium from source. Sounds like you didn't since your appium directory is not a git repository.

vamsi krishna racha

unread,
Aug 8, 2013, 7:53:08 AM8/8/13
to appium-...@googlegroups.com
Hey Swapna,

the appium.app stops at info: [ADB] Waiting for device 007c7266xxxxx to be ready and to respond to shell commands
does not go beyond that, could you help me with this 

I have the app already installed on the phone and i'm using the appium.app to launch it with package name and activity mentioned.

Thanks
Message has been deleted

Dipti Ranjan Lenka

unread,
Sep 5, 2013, 5:15:37 AM9/5/13
to appium-...@googlegroups.com, Swapna chennadi
where to get the 1.6.4 version as i have only able to see the 0.8.5 version as the latest in the appium.io
kindly let us know.

Dan Cuellar

unread,
Sep 5, 2013, 10:40:06 AM9/5/13
to appium-...@googlegroups.com, Swapna chennadi
1.6.4 is older than 0.8.5. A few months ago we started using the same version numbers for the .app and the node package.

Pooja Shah

unread,
Feb 13, 2014, 2:45:30 AM2/13/14
to appium-...@googlegroups.com
Dear Dan,

while using device, component selector(red rectangle) is not showing in inspector  while recording the test, and so Tap event/sendKeys gets recorded with 'null' (wherever I click , no details appear in bottom right corner), while the same works fine in emulator.
Message has been deleted

Isaac Murchie

unread,
Jul 7, 2014, 1:51:15 PM7/7/14
to akansh tayal, appium-...@googlegroups.com
What is output in this step if you run with --verbose ?


On Sun, Jul 6, 2014 at 5:45 AM, akansh tayal <akansh...@gmail.com> wrote:
Hello All,

I am trying to run reset.sh and getting the below error - 

RESETTING GENERAL
* Setting git revision data
Running "setGitRev" task
Config file exists, updating it
{"git-sha":"1bd74d7914736ea8c053f949b787b2db23a6ed66"}
Done, without errors.
RESETTING ANDROID
* Configuring Android bootstrap
Running "configAndroidBootstrap" task
Error: Target id is not valid. Use 'android list targets' to get the target ids.
Warning: Setup cmd /home/akansh/Downloads/android-studio/sdk/tools/android failed with code 1 Use --force to continue.

Aborted due to warnings.
---- FAILURE: reset.sh exited with status 1 ----


Please help me in resolving this. I am struck with this from the last 2 days.

Thanks,
Akansh

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages