[TIMOB-14784] CLI: Create ADB Library
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-08-28T23:18:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 18 Core, 2013 Sprint 18, Release 3.2.0 |
Components | Android, Tooling |
Labels | androidbuild, ay-verified, cb-verified, module_CLI, qe-testadded |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2013-08-08T16:47:58.000+0000 |
Updated | 2014-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
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.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/4612
To test:
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:
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
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
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