I want to profile an Android application on a physical Android device without using a USB connection from the device to my computer. The device's USB port is being used by a peripheral that is essential to my application.
I'm using the Android Wifi ADB Android Studio plugin and have successfully connected the device to utilise the bridge to Android Studio 3.2.1
When I attempt to begin a new profiling session using the Android Profiler my connected device appears to have "no debuggable processes."
How can I profile my application without a USB connection to my Android device?
You need to enable adb integration,
Go to Tools-->Android-->Check Enable ADB Integration
It was a default feature a few versions ago but now it has been disabled by default.
I've found a solution thanks to Unity's list of Android profilers.
At this time on Android Studio version 3.2.1 ADB and the Android Profiler do not work together over WiFi.
For my case I've found simpleperf to be acceptable, a tool which includes functionality to generate CPU flame graphs. I used run_simpleperf_without_usb_connection.py specifically, as documented in the simpleperf README available here.
Related
It would be great if we can debug Android apps on Windows Subsystem for Android.
Of course that is possible, it works similar to any external device.
First enable Developer mode in Windows Subsystem for Android Settings application.
Windows Subsystem for Android settings application
Then, connect ADB either like adb.exe connect 127.0.0.1:58526 or adb.exe connect <that ip assigned to your WSA device> once connect, just proceed as usual.
Go to Run -> Select Device
Android Studio select device menu
If ADB had connected correctly, it will be listed there as Microsoft Corporation Subsystem for Android(TM)
List of devices available to connect to in Android Studio
And that's it, it will be available as target the external device to debug with.
Android Studio and WSA
Now you can compile and Debug (Shift+F9) from Android Studio and Windows Subsystem for Android launching it and pausing accordingly (breakpoints, exceptions, etc.)
Debugging APK from Android Studio with WSA
Debugging APK from Android Studio with WSA
If you want to tweak more the debugging settings, you can launching its View in WSA from that Settings application.
WSA more debugging settings from within the Android instance itself
I followed the directions here How to test android apps in a real device with Android Studio? to test an app on a real android device, but it explains how to do so in Windows but not a MAC. How can I test an app on a real android device using an Android Studio that's installed on MAC?
Testing on MAC is more easier than Windows because if you have android device which is from well-known company, you already have USB driver installed on MAC.
Follow these steps to test Android device on MAC.
Open Android Studio
Connect Android device via USB
Now you should able to see your device just like in below screenshot
If not try "Troubleshoot device connection" menu. see screenshot.
You are now good to go with running your app first time on MAC :)
After trying Troubleshoot device connection, if you see a message like this:
- Device is waiting for you to grant permission for USB debugging
Go to Settings -> Developer options and Switch off and On again and it should show the message to allow connection.
The experimental Web Bluetooth API works quite well in the Dev version of Chrome for Android Marshmallow. I can simply enable the experimental flag at chrome://flags/#enable-web-bluetooth and I'm good to go.
Sadly the Web Bluetooth API doesn't work on my Android Lollipop device. Why?
UPDATE: As of April 17th, 2017, Web Bluetooth on Android now requires Android Marshmallow: http://crbug.com/694332
First of all, thanks for asking. You're not the only one for sure...
As mentioned in https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md#notes,
Tip of tree Chromium builds work on Android Lollipop or later for ease of developers
- but Chrome versions will only ever support Marshmallow or later.
So here's how to play with Web Bluetooth on Chrome for Android Lollipop:
Open the Android Settings app
Make sure "Developer Options" are unlocked and available - help
Select "Developer" and enable "USB Debugging"
Plug your Android device to your computer
Accept "USB Debugging" session on your Android Device
Download the latest Chromium build for Android at https://download-chromium.appspot.com/?platform=Android on your computer
Extract the downloaded chrome-android.zip file in your ~/Downloads folder for instance
Install ADB on your computer if it's not already there yet
Install Chromium by typing adb install -r ~/Downloads/chrome-android/apks/ChromePublic.apk in your shell
Open the new Chromium App on your Android device
Accept a Chromium Location prompt by going to https://www.google.com for instance - Location permission is needed to access Bluetooth in Chrome for Android Lollipop.
Finally enable the experimental flag at chrome://flags/#enable-web-bluetooth and/or request an Origin Trial token so that your website can use the Web Bluetooth API without any flag.
Play with some Web Bluetooth samples at https://googlechrome.github.io/samples/web-bluetooth/
Notes:
When using Web Bluetooth, make sure Android Bluetooth and Location in the drop down Quick Settings are turned on.
You may want to toggle Android Bluetooth off and on sometimes... Just saying ;)
Report bugs to the chromium team at https://bugs.chromium.org/p/chromium/issues/entry?components=Blink%3EBluetooth
Warning! The Chromium build for Android won't auto-update like Google Chrome. If you want a new build of Chromium to test new features, you'll have to re-download one and re-install it on your Android device.
I want to deploy my application to emulator on iPad 3 (retina) without using cable. Is it possible to deploy apps to emulator over wi-fi?
Smartface App Studio supports "Device Emulator" over Wi-fi , but because of perfoamnce issues it is disabled for current releases. You can check it from File Menu -> Project Details -> Debug / Emulator Settings.
USB Connection is always the best option in terms of performance and stability, in addition to this you can emulate your app manually with using Virtula Connection.
Take a look at TestFlightApp. It will allow you to deploy builds to devices via internet.
Currently i am building a mobile app on ubuntu 11.10 system.For checking the local app on phone i am using emulator.Is it possible to check the local app through my android phone.via emulator i am accessing my app via 10.0.2.2:3000.For android mobile how to do
Read up on Using Hardware Devices in the android dev guide.
You'll need to enable ADB on your device also, then plug it in with USB. Depending on your device you might have to find some ADB drivers for it.