{"componentChunkName":"component---node-modules-gatsby-theme-blog-core-src-templates-post-query-js","path":"/send-adb-command-to-all-devices/","result":{"data":{"site":{"siteMetadata":{"title":"one melo a day","social":[{"name":"twitter","url":"https://twitter.com/melo0187"},{"name":"github","url":"https://github.com/melo0187"}]}},"blogPost":{"__typename":"MdxBlogPost","id":"32736f66-7def-5241-999b-137d1e17a8b6","excerpt":"When a bug in your Android app is hard to reproduce, it can make sense to install a debuggable version of your app on more than one device…","body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"layout\": \"post\",\n  \"title\": \"Quicktip: Send ADB command to all connected devices\",\n  \"author\": \"melo\",\n  \"date\": \"2017-08-08T15:59:59.000Z\",\n  \"categories\": [\"Android\", \"Aside\", \"Technical\"],\n  \"slug\": \"send-adb-command-to-all-devices\",\n  \"draft\": false,\n  \"meta_title\": \"Quicktip: Send ADB command to all connected devices\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"When a bug in your Android app is hard to reproduce, it can make sense to install a debuggable version of your app on more than one device. Some helpful folks shared an easy way to  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"adb install\"), \"  to all connected devices with just one command on \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://stackoverflow.com/a/8610829\"\n  }), \"stackoverflow\"), \". Based on that I created the following alias: \", \"[\", \"code lang=text\", \"]\", \" alias adb+=adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb -s X \", \"[\", \"/code\", \"]\", \" This performs an  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"adb devices\"), \" , starts to read from the output\\u2019s 2nd line, gets the serial number in each line and for each line builds the command  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"adb -s *serial number*\"), \" . For a full explanation you can check out that command on a web site I find quite useful: \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://explainshell.com/explain?cmd=adb+devices+%7C+tail+-n+%2B2+%7C+cut+-sf+1+%7C+xargs+-IX+adb+-s+X\"\n  }), \"explainshell\"), \" With that alias in place you can now install your app to all connected devices that show up in  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"adb devices\"), \"  with nothing more than this: \", \"[\", \"code lang=text\", \"]\", \" adb+ install \", \"*\", \"your\", \"_\", \"debuggable.apk\", \"*\", \" \", \"[\", \"/code\", \"]\", \" Quick and easy, isn\\u2019t it? :-)\"));\n}\n;\nMDXContent.isMDXComponent = true;","slug":"/send-adb-command-to-all-devices/","title":"Quicktip: Send ADB command to all connected devices","tags":[],"keywords":[],"date":"August 08, 2017"},"previous":{"__typename":"MdxBlogPost","id":"e9278a56-8e6e-5aa9-85db-c1cc0855fc8e","excerpt":"Use Google USB drivers on Windows regardless of the device vendor","slug":"/use-google-usb-drivers-on-windows-regardless-of-the-device-vendor/","title":"Quick ADB setup for any Android device","date":"August 06, 2017"},"next":{"__typename":"MdxBlogPost","id":"9b9ecf8f-33f4-589d-b078-ed291093181a","excerpt":"How I used Docker to package the CF java-buildpack in minutes","slug":"/package-java-buildpack-with-docker/","title":"Package Cloud Foundry java-buildpack with Docker","date":"November 26, 2017"}},"pageContext":{"isCreatedByStatefulCreatePages":false,"id":"32736f66-7def-5241-999b-137d1e17a8b6","previousId":"e9278a56-8e6e-5aa9-85db-c1cc0855fc8e","nextId":"9b9ecf8f-33f4-589d-b078-ed291093181a"}}}