Android Studio on Windows - Following successful Gradle sync and build, I am unable to launch my application on my (rooted) Android Galaxy S3 and debug via USB. I have USB Debugging enabled on my device.
I am able to:
provision and debug via the debug interface on the emulator
see my USB device in the Android DDMS window:
manually provision via adb, then connect via the debugger, using the same commands that come out of the debug window in Android Studio:
Cd "C:\Program Files (x86)\Android\android-studio\sdk\platform-tools"
adb -d shell
su
pm uninstall com.company.myapplication
ls -all /data/app | grep myapplication
pm install -r "/data/local/tmp/com.company.myapplication"
am start -n "com.company.myapplication/com.company.myapplication.MapsActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Following manual provisioning (see above), I can attach to the running process on my device, and debug (including hitting breakpoints):
Select my device from the "Choose Device" window when attempting to initiate USB debugging:
... following which I get the following output (and no activity on the Android device UI):
Waiting for device.
Target device: samsung-sgh_t999-6XXXXXX2
Uploading file
local path: D:\Data\XXXXXX\Sandpit\XXXXXX\MyApplication\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.company.myapplication
Installing com.company.myapplication
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.company.myapplication"`
Launching application: com.company.myapplication/com.company.myapplication.MapsActivity.
DEVICE SHELL COMMAND: am start -D -n "com.company.myapplication/com.company.myapplication.MapsActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process: com.company.myapplication
In the case above, after checking files using the adb shell, I have noticed that the pm install command works -- i.e. there's an updated file (based on timestamp) in location /data/local/tmp/com.company.myapplication. However, the am start doesn't work, as the .apk file under
I have tried:-
Restarting the computer
Restarting the Android device
Reinstalling Android Studio
Run app (rather than Debug app): same result, no app installation on Android device
Creating a new test application to see whether it's a problem with Gradle or Manifest configuration problems in my original application.
Cleaning the project
Connecting as both a Media device (MTP), and also as Camera (PTP)
Enabling mock locations (Settings -> Developer options -> Allow mock locations)
Adding android:debuggable="true" to the Android Manifest XML (<appRoot>\MyApplication\app\src\main\AndroidManifest.xml), despite IDE suggestion to the contrary:
Ensuring ADB Integration is enabled:
Toggling the ADB connection on the phone (Settings -> Developer Options -> USB Debugging check/uncheck/recheck, reconnect)
Updating to the latest Samsung drivers for the S3 - downloaded, refreshed in Windows Device Manager:
Restarting the ADB Server, including as root, then re-connecting (and subsequently re-attempting debugging from Android Studio over USB):
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb wait-for-device
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb devices
List of devices attached
6XXXXXX2 device
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb root
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb kill-server
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb wait-for-device
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb devices
List of devices attached
6XXXXXX2 device
C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>
Versions:-
I had Android Studio v0.8.2, but as part of my testing efforts have since downgraded to 0.8.1, which also doesn't work (same problem).
Cell phone is SGH-T999, Android version 4.1.2
OS is Windows 7 Enterprise SP1
What have I omitted? What else should I try?
Maybe installing the Universal ADB Driver will help. (Download)
Just to provide closure... I ended up dropping this device, and it wasn't worth repairing the screen, so this device no longer exists. My new device - also an S3 - works after being rooted.
Related
I try to build simple_game from templates to Android and install it on an Android device.
But I have a problem with installation to Android devices, especially with the ADB part.
Simple_game
I use the manual to build at:
Build manual
but I have a little bit of trouble with the last step.
When I connect my Android device to PC a use command prompt to step into simple_game directory and run
ADB devices
PC see Android device, this device is in device list. I have set developer mode on Android device, installed new driver to see device for PC, set USB debugging and confirmed use this Android device with PC.
After this, I run the command
mingw32-make PLATFORM=PLATFORM_ANDROID
but the part in Makefile.Android with ADB doesn't work.
Here is last echo in screen
C:\open-jdk/bin/jarsigner -keystore android.simple_game/simple_game.keystore -storepass raylib -keypass raylib -signedjar android.simple_game/bin/simple_game.signed.apk android.simple_game/bin/simple_game.unsigned.apk simple_gameKey
jar signed.
Warning:
The signer's certificate is self-signed.
C:/android-sdk/build-tools/29.0.3/zipalign -f 4 android.simple_game/bin/simple_game.signed.apk simple_game.apk
mingw32-make[3]: Leaving directory 'C:/raylib/raylib/templates/simple_game'
C:\raylib\raylib\templates\simple_game>
When I try run adb separatly, I get error
C:\RAYLIB\templates\simple_game>adb install simple_game.apk
* daemon not running; starting now at tcp:5037
* daemon started successfully
Performing Streamed Install
adb: failed to install simple_game.apk: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.raylib.rgame-G49JemMPBwfUFp_sJK7aFQ==: Package /data/app/com.raylib.rgame-G49JemMPBwfUFp_sJK7aFQ==/base.apk code is missing]
C:\RAYLIB\templates\simple_game>
Do anyone know how to fix this problem and succesufuly install apk file to android device?
Thank You
Why dont you try the following:
1.Connect android device to PC using USB cable and ensure "file transfer" mode is enabled.
2.Activate developer settings in your device.
3.Enable USB debugging on your device.
4.Android studio should detect your device in ADB manager.
On running the app an apk file will be created on your android device and you can run the app from there.
I'm trying to work with uiautomation viewer. When I connect to it and press "device screenshot" button, I get:
no android devices were detected by adb
error obtaining devices
screenshot
Resources:
Windows 10 (host) running adb server "adb -a nodaemon server"
Linux guest (virtual box) -run adb devices from it and get the id of the device (so far so good).
On Linux, I installed Android Studio and try via sdk>tool>bin to run the uiautomation viewer.
What's done so far :(according to answers all over the net)
Change the path inside uiautomationviewer file to :
Dcom.android.uiautomator.bindir=/home/ohad/Android/Sdk/tools (while in /bin we have the uiautomationvewr file.
The path of adb is ("adb which")- /home/ohad/Android/Sdk/platform-tools/adb
I work with titanium studio version 3.0.3
When I run my project into Android device, I got the errors:
[ERROR] : Project failed to build after 287ms
It can not detect my device.
I installed the USB driver for sumsung and i configure Android device by Enable Unknown sources and Enable USB debugging.
In my eclipse IDE, I can detect my device and run my projects without probleme.
Can I give me some help, how can I deploying my projet to android device In titanium Studio
thanks :)
I use the following little script to launch the app on my device:
$SN variable defines the id of the device. You can get it by running adb devices
ti build -p android --build-only;
adb -s $SN uninstall com.example;
adb -s $SN install build/android/bin/applicationName.apk ;
adb -s $SN shell am start com.example/com.example.ActivityName
If you want to keep your application data in place, you should do the following:
adb -s $SN install build/android/bin/applicationName.apk ;
I'm assuming you have configured your PATH correctly.
Launch the script from your application folder.
You will have to change com.example and com.example.ActivityName to match your configuration.
I am trying to install apk via usb is not installing.
Device is detected perfectly .but apk is not installing.
Even i tried with the following command.
D:\Softwares\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb install f:Fi
lth\Sample\bin\Sample.apk
4669 KB/s (277327 bytes in 0.058s)
D:\Softwares\adt-bundle-windows-x86-20131030\sdk\platform-tools>
First, check whether your device is connected or not. If connected, check there is only one device running i.e. mobile or emulator.
Copy your apk file and paste inside the platform-tools folder
D:\Softwares\adt-bundle-windows-x86-20131030\sdk\platform-tools>
now shift+right click on the platform-tools folder -> Open command window here
Then check whether your adb is running successfully or not.Try these command to restart adb
adb kill-server
adb start-server
now you got the message "daemon started successfully"
now just use
adb install Sample.apk
Check out the image if you still have any problem.
I was developing a “hello world” android application using intellij IDE 11.0.01 and android SDK 4.0.3.
I ran the application using intellij, emulator was launched but it was not showing my application. Android logcat was also empty.
I closed the emulator. Killed the process adb.exe from task manager.
Then I followed the following steps:
1.Copied the .apk file to android \platform-tools folder.
2.Started the emulator from SDK manager.
3.Open the command prompt and changed the path till \platform-tools folder
4.Execute the commands:
adb kill-server
adb start-server
adb install my_app.apk
I am getting following error:
** daemon not running. starting it now on port 5037 * * daemon started successfully * ** daemon still not runningerror: cannot connect to daemon
I am using Windows XP Professional Version 2002 Service Pack 3.I am working from my personal laptop and I do not have any antivirus or firewall started.
Could anyone please provide me information how to proceed from here?
If all fails, you could try installing the apk using adb:
adb install <path_to_apk>
Execute that commmand in a command window in the same folder as adb.