The power of root on Android emulators

Similar documents
Reminders. Lab opens from today. Many students want to use the extra I/O pins on

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

ITG Software Engineering

Introduction to Android Development. Jeff Avery CS349, Mar 2013

An Introduction to Android

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Running a Program on an AVD

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Fahim Uddin 1. Java SDK

Android Mobile App Building Tutorial

Introduction to Android

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Robotium Automated Testing for Android

Practical Android Projects Lucas Jordan Pieter Greyling

Android Development. Marc Mc Loughlin

Open Source Telemedicine Android Client Development Introduction

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Lab 4 In class Hands-on Android Debugging Tutorial

Introduction to Android Programming (CS5248 Fall 2015)

Getting started with Android and App Engine

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Introduction to Android

Smartphone market share

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Android Setup Phase 2

CS378 -Mobile Computing. Android Overview and Android Development Environment

An Introduction to Android. Huang Xuguang Database Lab. Inha University

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

Chapter 2 Getting Started

01. Introduction of Android

Homework 9 Android App for Weather Forecast

Programming with Android

VM Application Debugging via JTAG: Android TRACE32 JTAG Debug Bridge ADB Architecture Stop-Mode implications for ADB JTAG Transport Outlook

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

Lecture 1 Introduction to Android

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Android Developer Fundamental 1

Module Title: Software Development A: Mobile Application Development

Overview of CS 282 & Android

1) SETUP ANDROID STUDIO

ANDROID INTRODUCTION TO ANDROID

Android Development Setup [Revision Date: 02/16/11]

Software development. Development requirements. Java. Android SDK. Eclipse IDE (optional)

OpenCV on Android Platforms

-Android 2.3 is the most used version of Android on the market today with almost 60% of all Android devices running 2.3 Gingerbread -Winner of

Setting up Sudoku example on Android Studio

Setting Up Your Android Development Environment. For Mac OS X (10.6.8) v1.0. By GoNorthWest. 3 April 2012

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

Jordan Jozwiak November 13, 2011

DEVELOPING MOBILE APPLICATIONS USING ANDROID

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Beginner s Android Development Tutorial!

Hello World. by Elliot Khazon

With a single download, the ADT Bundle includes everything you need to begin developing apps:

Introduction to Android Development

Board also Supports MicroBridge

How to Create an Android Application using Eclipse on Windows 7

How To Develop Android On Your Computer Or Tablet Or Phone

Mobile Security - Tutorial 1. Beginning Advanced Android Development Brian Ricks Fall 2014

Introduction to Android

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Developing with Android Studio

ADT Plugin for Eclipse

Android Programming: Installation, Setup, and Getting Started

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Basic Android Setup Windows Version

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Getting Started with Android Development

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Android Geek Night. Application framework

Android Environment SDK

Android Programming and Security

Android Development: a System Perspective. Javier Orensanz

System Reference 2013

Mobile and Social Computing

Android For Java Developers. Marko Gargenta Marakana

Building graphic-rich and better performing native applications. Pro. Android C++ with the NDK. Onur Cinar

Additional details >>> HERE <<<

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Android Application Development

Pentesting Android Apps. Sneha Rajguru

Mobile Application Development Android

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Android Application Development Lecture Notes INDEX

Android (Basic + Advance) Application Development

Mercury User Guide v1.1

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

Example of Standard API

Praktikum Entwicklung Mediensysteme (für Master)

Android Application Development. Daniel Switkin Senior Software Engineer, Google Inc.

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Azure Day Application Development

Getting Started: Creating a Simple App

Tutorial on Basic Android Setup

Android, Bluetooth and MIAC

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Transcription:

The power of root on Android emulators Command line tooling for Android Development Gabe Martin LinuxFest Northwest 2013 10:00 AM to 10:50 AM, CC 239 Welcome Describe alternative title Questions can be asked between immediately following demos

About Me Android Developer (2010-Present) Android Mobile developer Windows Developer 2000-2011 Enterprise desktop software development. Primarily Windows, Primarily C++ /. NET WWU Computer Science 2001

Presentation topics Interacting with Android components Activities, Services, Broadcast Receivers, Content Providers Utilizing Android SDK / Emulator tools for development and testing adb, ant, am, content, run-as Identifying differences between developing on different types of devices Emulators, rooted devices, stock devices

Android SDK Overview Free / Open Source Multi-platform (Mac, Linux, Windows) Java based Build Tools Debug tools Platforms (Android 1.5 - API3 to Android 4.2.2 API 17) Emulator API Add-ons Platform Library Overview of Android Tooling Not all platforms are supported equally Mac Best supported. Emulators are usable and connecting to Android devices "just works." Linux Some configuration required for adb access. Windows Requires cygwin for some features. Difficult to detect some devices via ADB. Build Tools: android, ant, proguard Development tools: adb, sqlite3, profilers, monkey runner Eclipse IDE (ADT) is the recommended IDE for Android development. Many other are available including NetBeans, IntelliJ?, Visual Studio SDK Download: http://developer.android.com/sdk/index.html

Android SDK Demo Demo: Building an Android app using the SDK and command line Run: copy../bootstrappresentations.sh. cat bootstrappresentations.sh - if no network access is available or github error use local files android avd & # start emulator ant debug install # debug and install

Apps - Desktop vs Android App Lifetime Desktop Apps - process bound Have an entry point method and app exits once completed Android Apps - state bound Processes can be killed at any point and restored with existing state Key difference What happens when the app or process is "killed" by user or system Android SDK links: http://developer.android.com/training/basics/activity-lifecycle/index.html

Activity From the Android SDK An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. Activities are "stacked" and popped off when back is pressed. The Activity backstack is preserved by the system and not tied to a process. Learn more about Activities at David Schwegler's Developing for Android's Uniqueness Android SDK links: http://developer.android.com/training/basics/activity-lifecycle/index.html http://developer.android.com/guide/components/activities.html

Activities and apps Activity Activity Activity Activity Content Provider Service Dalvik VM Process Android System Linux Activities are "stacked" and popped off when back is pressed. The Activity backstack is preserved by the system and not tied to a process. Learn more about Activities at David Schwegler's Developing for Android's Uniqueness Android SDK links: http://developer.android.com/training/basics/activity-lifecycle/index.html

Activity Demo Demo: Starting Activities and killing processes from the command line Demo Start 4 activities in a row. Show how you can kill the process which effectively pops the last activity off the stack. test/showallprocesses.sh test/startactivities.sh test/showallprocesses.sh test/showappprocess.sh test/killprocess.sh test/killprocess.sh test/killprocess.sh test/startactivities.sh test/forcestop.sh Native app crashes behave in a similar manner.

Services From the Android SDK A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Examples Downloading content Playing music More on Services - http://developer.android.com/guide/components/services.html

Services Demo Demo: Starting a service with an intent from command line Demo test/forcestop.sh test/showappprocess.sh # Verifies app processes are not running test/startupdatesessionsforced.sh # Creates a new process and starts service test/showappprocess.sh # Shows that a process was started to run the service and is still running

Broadcast Receivers From the Android SDK A broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Applications can also initiate broadcasts for example, to let other applications know that some data has been downloaded to the device and is available for them to use. http://developer.android.com/guide/components/fundamentals.html

Broadcast Receivers Demo Demo: Sending broadcast intents from command line Demo test/startsessionsactivity.sh test/broadcastupdatestarted.sh test/broadcastupdatecompleted.sh test/broadcastupdaterefreshcontent.sh

Content Providers From the Android SDK: A content provider manages a shared set of application data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your application can access. Through the content provider, other applications can query or even modify the data (if the content provider allows it). http://developer.android.com/guide/components/fundamentals.html sqlite3 is available on emulators but has limitations. Namely no command history support Demo Use content command to change the SECURE_ID used by the emulator.

Content Provider Demo Demo: Interacting with Content Providers from the command line showappprocess.sh simplequeryprovider.sh provider showappprocess.sh simpleinserthelloworld.sh simplequeryprovider.sh simpleinsertgoodbyeworld.sh simplequeryprovider.sh killprocess.sh showappprocess.sh querywebcontentprovider.sh provider # verify not currently running # starts process - queries empty simple content # container process started # inserts data # queries data # inserts more data # queries data # verify not currently running # starts process - queries empty simple content querywebcontentprovider.sh # Demonstrate a ContentProvider that can make web queries - dangerous. possibly allows apps to query other apps content providers for possibly sensitive or not allowed behavior

Android Database Fundamentals Sqlite based Default db storage location /data/data/<app>/databases/<dbname>.db Interacting with databases on emulators, easy! sqlite3 binary included in device images emulators have root access so db files are accessible Accessing databases on non-rooted devices, tricky but doable Debuggable Android apps support run-as run-as broken on Android 2.2 when more than 50 apps are installed

Run-as command demo Demo: Accessing private databases The run-as command is what makes it possible to debug apps on stock devices. Useful command to also access otherwise restricted data. runasshowdatabases.sh runasmakesessionsdatabasewritable.sh runaspullsessionsdatabase.sh runasmakesessionsdatabasereadonly.sh sqlite3 Sessions.db Also very useful for accessing/changing private app preferences and files

Monkey - because it's fun Demo: monkey test tool for fuzz testing UI Demo monkey.sh # starts the monkey.sh UI fuzz testing tool

The End Questions? Git Repos https://github.com/gabema/lfnw/tree/commandline https://github.com/gabema/lfnwsampleapp Google Presentation https://docs.google. com/presentation/d/1ryctjgct6owazsu6kuenzbywdh4lyza5bw4zn10ywks /edit?usp=sharing Special Thanks David Schwegler for making an awesome LFNW 2013 app (Make sure to attend Developing for Android's Uniqueness at 1:30 same room)