Tutorial by Examples: device

To get a verbose list of all devices connected to adb, write the following command in your terminal: adb devices -l Example Output List of devices attached ZX1G425DC6 device usb:336592896X product:shamu model:Nexus_6 device:shamu 013e4e127e59a868 device usb:337641472X produc...
Write the following command in your terminal: adb shell getprop This will print all available information in the form of key/value pairs. You can just read specific information by appending the name of a specific key to the command. For example: adb shell getprop ro.product.model Here are a...
execute the following command to insert the text into a view with a focus (if it supports text input) 6.0 Send text on SDK 23+ adb shell "input keyboard text 'Paste text on Android Device'" If already connected to your device via adb: input text 'Paste text on Android Device' 6...
The standard ADB configuration involves a USB connection to a physical device. If you prefer, you can switch over to TCP/IP mode, and connect ADB via WiFi instead. Not rooted device Get on the same network: Make sure your device and your computer are on the same network. Connect the...
You may pull (download) files from the device by executing the following command: adb pull <remote> <local> For example: adb pull /sdcard/ ~/ You may also push (upload) files from your computer to the device: adb push <local> <remote> For example: adb push ~/im...
You can reboot your device by executing the following command: adb reboot Perform this command to reboot into bootloader: adb reboot bootloader Reboot to recovery mode: adb reboot recovery Be aware that the device won't shutdown first!
Command: adb devices Result example: List of devices attached emulator-5554 device PhoneRT45Fr54 offline 123.454.67.45 no device First column - device serial number Second column - connection status Android documentation
Enter these commands in Android device Terminal su setprop service.adb.tcp.port 5555 stop adbd start adbd After this, you can use CMD and ADB to connect using the following command adb connect 192.168.0.101.5555 And you can disable it and return ADB to listening on USB with setprop servi...
Here is how to make a Heads Up Notification for capable devices, and use a Ticker for older devices. // Tapping the Notification will open up MainActivity Intent i = new Intent(this, MainActivity.class); // an action to use later // defined as an app constant: // public static final String ME...
This will give current system version. Objective-C NSString *version = [[UIDevice currentDevice] systemVersion] Swift let version = UIDevice.currentDevice().systemVersion Swift 3 let version = UIDevice.current.systemVersion
private static final int REQUEST_DISCOVERABLE_BT = 2; // Unique request code private static final int DISCOVERABLE_DURATION = 120; // Discoverable duration time in seconds // 0 means always discoverable ...
Declare a BluetoothAdapter first. BluetoothAdapter mBluetoothAdapter; Now create a BroadcastReceiver for ACTION_FOUND private final BroadcastReceiver mReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); //...
1. Target a device by serial number Use the -s option followed by a device name to select on which device the adb command should run. The -s options should be first in line, before the command. adb -s <device> <command> Example: adb devices List of devices attached emulator-55...
Screen shot: Option 1 (pure adb) The shell adb command allows us to execute commands using a device's built-in shell. The screencap shell command captures the content currently visible on a device and saves it into a given image file, e.g. /sdcard/screen.png: adb shell screencap /sdcard/screen.png...
XML <Galaxy> <Light>sun</Light> <Device>satellite</Device> <Sensor>human</Sensor> <Name>Milky Way</Name> </Galaxy> XPATH /Galaxy/*[local-name()='Light' or local-name()='Device' or local-name()='Sensor'] or //*[...
Enable USB Debugging on your device and from command line type adb devices. If everything is OK, the response should be: List of devices attached 1234567890 device Where 1234567890 is the device's id. If multiple devices are connected, you should see all of them: List of devices at...
Build.VERSION_CODES is an enumeration of the currently known SDK version codes. In order to conditionally run code based on the device's Android version, use the TargetApi annotation to avoid Lint errors, and check the build version before running the code specific to the API level. Here is an exa...
To register your device for push notifications, add the following code to your AppDelegate file in didFinishLaunchingWithOptions method: Swift func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for c...
If your application is going to run on different devices, it's going to need to render to different ViewPorts, based on the device size. You can deal with this in two ways: with javascript rules, or CSS media styles. If you've been using a MVC or MVVM library, such as Angular or Ember (or Blaze, for...
Make sure your development workstation and iPhone are connected to the same WiFi network. Tethering, hotspots, and other ad-hoc networking won't work. Run sudo meteor run ios-device Deploy to your device!

Page 1 of 4