Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14784] CLI: Create ADB Library

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-08-28T23:18:44.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 18 Core, 2013 Sprint 18, Release 3.2.0
ComponentsAndroid, Tooling
Labelsandroidbuild, ay-verified, cb-verified, module_CLI, qe-testadded
ReporterChris Barber
AssigneeChris Barber
Created2013-08-08T16:47:58.000+0000
Updated2014-02-12T01:51:42.000+0000

Description

We need an ADB library that provides the following functions: * devices * start-server * kill-server * install ** allow installation to a specific device/emulator (TIMOB-12600 CLI: building for Android device while the emulator open generates a wrong Error Message) ** gracefully handle FAILED_INSUFFICIENT_STORAGE errors (TIMOB-14701 CLI: Android: For emulator builds, check that emulator has sufficient space) *** if insufficient storage space, display instructions on how to resolve (TIMOB-9859 Android: increase AVD storage size to reduce \[FAILED_INSUFFICIENT_STORAGE\] errors) * shell * push * forward * start app (TIMOB-13105 CLI: Add build support for building android apps on emulator without starting the app) * kill running app

Comments

  1. Allen Yeung 2013-08-26

    Summary log from chat recorded on poker session CLI Sprint 18 poker planning: [11:23:29 PM] Matt Langston: 1/4 to 1/3 is calling adb shell. The remainder is using the adb TCP protocol.
  2. Chris Barber 2013-08-27

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4612
  3. Chris Barber 2013-08-27

    To test:
       cd titanium_mobile/support/node_modules/titanium-sdk/tests
       
    Open the "test-adb.js" file in an editor and uncomment a test to run. I recommend 1 test at a time. You will need to run "adb devices" to find various device ids to test with, then update the test-adb.js file with the ids. You can do all the testing with a single emulator, but it might be slower. To run the test, run:
       node test-adb.js
       
    Tests: *testVersion()* Just uncomment and run. If the adb server is not running, it will start it up. *testDevices()* Just uncomment and run. It will print all devices and emulators. You can start/plug in more devices, then rerun. You should see details for each device. *testTrackDevices()* Just uncomment and run. It will print all devices and emulators. While it's running, continue to add and remove devices/emulators and watch the output update the list of connected devices. *testShell()* Uncomment, then update the device id in the test function with your id, then run. It should dump the build.prop file. *testStartApp()* Uncomment, then update the device id in the test function with your id. If you are testing with a device, then change the app id to run to something that actually exists on your device, then run. App should start. *testStopApp()* Uncomment, then update the device id in the test function with your id. If you are testing with a device, then change the app id to run to something that actually exists on your device, then run. App should stop (assuming it's running). *testInstallApp()* You will need to build an Android app to get the build/android/bin/app.apk file. Next uncomment the test function call and update the test function with the correct device id and path to the apk file. It may take a few seconds to install. If the device has insufficient space, then display the appropriate error. *testGetPid()* Uncomment, update device id and app id, then run the test. Test with the app running and not running. *testForward()* Uncommnent, update device id and run. If there's no errors, it must have worked. Right? *testPull()* Uncomment, update device id and update the 3rd arg to specify the local file to write (must be a file and not a directory). Run test and check the file was written. *testPush()* Uncomment, update device id, then run test. Next run "adb -s shell ls /mnt/sdcard/tmp/test-adb.js" to verify the file was written to the device.
  4. Eric Merriman 2013-12-05

    To test this you might need to clone the timob repo and run the test from there. Please see me for instructions on running the test. The path is SDK/node_modules/titanium-sdk/tests/test-adb.js
  5. Lokesh Choudhary 2013-12-06

    Tested following the test steps mentioned. Environment: Appcel Studio : 3.2.0.201312042306 Ti SDK : 3.2.0.v20131204220843 Mac OSX : 10.8.5 Alloy : 1.3.0-beta CLI - 3.2.0-beta Samsung Galaxy S4 running android 4.2.2 Nexus 5 - android 4.4

JSON Source