[Completed] adb emulator device offline - XDA Assist

I try to compile android 5.0.2 on ubuntu server. And I start a headless emulator with the args:
EMULATOR=/root/sdk-android/tools/emulator
SYSDIR=/root/5.0.2android/out/target/product/generic
SYSTEM=/root/5.0.2android/out/target/product/generic/system.img
RAMDISK=/root/5.0.2android/out/target/product/generic/ramdisk.img
DATA=/root/5.0.2android/out/target/product/generic/userdata.img
KERNEL=/root/5.0.2android/prebuilts/qemu-kernel/x86_64/kernel-qemu
SKINDIR=
export LD_LIBRARY_PATH="/root/sdk-android/tools/lib64:${LD_LIBRART_PATH}"
${EMULATOR} -sysdir ${SYSDIR} -system ${SYSTEM} -ramdisk ${RAMDISK} -data ${DATA} -kernel ${KERNEL} -noskin -memory 512 -partition-size 1024 -no-audio -no-window
Click to expand...
Click to collapse
My system info is full-eng. Adb version is 1.0.31. I download linux version sdk and found it doesn't contains adb. So I have to install adb using apt-get.
Then I use adb to connect to the emulator. The divices is always offline.
The error message is : emulator-5554 offline

clangllvm said:
I try to compile android 5.0.2 on ubuntu server. And I start a headless emulator with the args:
My system info is full-eng. Adb version is 1.0.31. I download linux version sdk and found it doesn't contains adb. So I have to install adb using apt-get.
Then I use adb to connect to the emulator. The divices is always offline.
The error message is : emulator-5554 offline
Click to expand...
Click to collapse
Hello, and thank you for using XDA Assist!
From what I've learned, you cannot use your distro's ADB, as it does not have the capability to connect to the emulator (and Ubuntu's ADB - like the one from Debian - may not be new enough to handle L anyways).
Strange that "platform tools" isn't there as an add-on...
At any rate, feel free to ask here:
> Android Development and Hacking > Android General > [GUIDE]All About ANDROID SDK/AVD {Install/AVDs/Root/ADB}
Hope this helps, and good luck!

Related

[TUTORIAL/HOW TO] Basics of ADB

Feel free to contribute - Creating this at toast's request
Will do my best to update this with everybody's experience and knowledge to help out the new comers. Welcome to the world of Android!!
Definition of ADB - http://developer.android.com/guide/developing/tools/adb.html
1. Install Drivers
Win 7 drivers - http://depositfiles.com/en/files/yd61xorii - thanks shep211.
Win 7 64bit, Vista and XP - Confirmed works with HTC Sync - thanks to crackerstyle OR use HTC Sync.exe from the stock MicroSD card shipped with the phone. Myn also used these drivers - http://member.america.htc.com/download/Driver/HTC EVO (Sprint)/HTC_Sync_2.0.40.exe
Mac OS X drivers -
Linux drivers -
2. Install ADB (part of Android SDK)
Google's Main page - on the Android SDK which contains the adb binary inside the tools folder - http://developer.android.com/sdk/index.html
Windows Specific Android SDK installer (contains ADB binary inside tools folder) - http://developer.android.com/sdk/download.html?v=android-sdk_r06-windows.zip
Linux Specific Android SDK installer (contains ADB binary inside tools folder) - http://developer.android.com/sdk/download.html?v=android-sdk_r06-linux_86.tgz
Mac Specific Android SDK installer (contains ADB binary inside tools folder) - http://developer.android.com/sdk/download.html?v=android-sdk_r06-mac_86.zip
3. Enabling ADB support on EVO
If using completely stock EVO, adb will be disabled in recovery and can't be enabled.
If using the PC36IMG.zip (userdebug RUU) automatically turns on adb in recovery mode.
If in normal android mode, adb can be enabled by Settings->Applications->USB Debugging.
4. Running (Executing) ADB on Host computer
Windows - start->run->cmd . Navigate to the extracted the Android SDK folder and into the subfolder called tools.
cd c:\android-sdk\tools\
Now simply execute the commands in Step 5 and 6.
5. Learn basic ADB commands
adb push - sends a file to the phone over ADB thru USB - adb push c:\test.apk /sdcard/test.apk
adb pull - receives a file from the phone over ADB thru USB - adb pull /system/app/Test.apk c:\Test.apk
adb shell - starts a shell connection with the phone
adb reboot - restarts the phone
adb reboot recovery - restarts the phone into recovery
adb reboot bootloader - restarts the phone into the bootloader (white screen)
adb remount - remounts the file system
adb install <path to .apk file> - installs an application - adb install c:\swype.apk
adb uninstall <package name> - uninstalls an application - package name is usually in the format, com.android.browser
6. Learn basic Linux commands to run through ADB shell
cd - changes directories - works through stock android toolbox - cd /system/app
ls - lists all files in the directory - works through stock android toolbox - ls /system/app/
cat - copies files - works through stock android toolbox - cat /system/app/Test.apk > /sdcard/Test.apk
rm - removes files - works through stock android toolbox - rm /system/app/Test.apk
mv - moves files from one location to another - works through stock android toolbox - mv /system/app/Test.apk /sdcard/Test.apk
cp - copies files - functions similar to cat - uses busybox installed by the EVO-recovery.zip into recovery mode - cp /system/app/Test.apk /sdcard/Test.apk
mount - loads the file system (usually auto loaded except sometimes in recovery) - mount /dev/block/mtdblock4 /system
unmount - unloads the file system - umount /system
joeykrim said:
Feel free to contribute - Creating this at toast's request
Will do my best to update this with everybody's experience and knowledge to help out the new comers. Welcome to the world of Android!!
1. Install Drivers
Win 7 drivers - http://depositfiles.com/en/files/yd61xorii - thanks shep211
2. Install ADB (part of Android SDK)
Google's Main page on the Android SDK which contains the adb binary inside the tools folder - http://developer.android.com/sdk/index.html
Windows Specific Android SDK installer (contains ADB) - http://developer.android.com/sdk/download.html?v=android-sdk_r06-windows.zip
Linux Specific Android SDK installer (contains ADB) - http://developer.android.com/sdk/download.html?v=android-sdk_r06-linux_86.tgz
Mac Specific Android SDK installer (contains ADB) - http://developer.android.com/sdk/download.html?v=android-sdk_r06-mac_86.zip
3. Learn basic ADB commands
adb shell - starts a shell connection with the phone
adb reboot - restarts the phone
adb remount - remounts the file system
4. Learn basic Linux commands to run through ADB shell
cat - works through stock android toolbox - copies files - cat /system/app/Test.apk > /sdcard/Test.apk
rm - works through stock android toolbox - removes files - rm /system/app/Test.apk
mv - works through stock android toolbox - moves a file from one location to another - mv /system/app/Test.apk /sdcard/Test.apk
cp - uses busybox installed by the EVO-recovery.zip into recovery mode - functions similar to cat - cp /system/app/Test.apk /sdcard/Test.apk
Click to expand...
Click to collapse
Thanks a ton joeykrim!!!!!!!!!!!!!!! Really helpful!!!!!!!
Yeah, super handy. I know enough linux to make my way around moving files and what not... but this saved me a few googles for download links and figuring out what adb was.
Danke danke.
how do you install the drivers?..it's just folders
jayv1717 said:
how do you install the drivers?..it's just folders
Click to expand...
Click to collapse
download file is blocked for me and i dont have win7 or the evo yet, so you'll have to help and hopefully others will chime in.
i would assume once you plug the phone in, it will prompt/ask for drivers, simply navigate to the folders from the download file.
jayv1717 said:
how do you install the drivers?..it's just folders
Click to expand...
Click to collapse
Just found this, read about halfway through the first post, under Installing Drivers
http://forum.xda-developers.com/showthread.php?t=532719
joeykrim said:
Feel free to contribute - Creating this at toast's request
Will do my best to update this with everybody's experience and knowledge to help out the new comers. Welcome to the world of Android!!
1. Install Drivers
Win 7 drivers - http://depositfiles.com/en/files/yd61xorii - thanks shep211
Win XP drivers -
Win Vista drivers -
Mac OS X drivers -
Linux drivers -
Click to expand...
Click to collapse
Aren't the drivers available through Android SDK. I know I just downloaded an usb_driver with the SDK Setup.
eddy g said:
Just found this, read about halfway through the first post, under Installing Drivers
http://forum.xda-developers.com/showthread.php?t=532719
Click to expand...
Click to collapse
That helped alot..thanks
finebrian224 said:
Aren't the drivers available through Android SDK. I know I just downloaded an usb_driver with the SDK Setup.
Click to expand...
Click to collapse
some drivers are.
did they work? what OS are you using?
For the record, I don't know about mac but I know linux doesnt need drivers.
forgot about ADB push?
dmc971989 said:
forgot about ADB push?
Click to expand...
Click to collapse
Also might want to add adb pull and install and devices. Also remember if it says it cannot find your device make sure usb debugging is set in Settings->Applications and type in adb kill-server and adb remount.
chuckhriczko said:
Also might want to add adb pull and install and devices. Also remember if it says it cannot find your device make sure usb debugging is set in Settings->Applications and type in adb kill-server and adb remount.
Click to expand...
Click to collapse
i was assuming push/pull went together... but i forgot about adb remount, good call
finebrian224 said:
Aren't the drivers available through Android SDK. I know I just downloaded an usb_driver with the SDK Setup.
Click to expand...
Click to collapse
No just fastboot drivers.
chuckhriczko said:
Also might want to add adb pull and install and devices. Also remember if it says it cannot find your device make sure usb debugging is set in Settings->Applications and type in adb kill-server and adb remount.
Click to expand...
Click to collapse
added path to enabling ADB from normal android mode.
dmc971989 said:
i was assuming push/pull went together... but i forgot about adb remount, good call
Click to expand...
Click to collapse
added adb push/pull and adb remount was already added.
thanks guys!
I just installed ADB USB driver, and I had to use the tip found below because the driver downloaded by the SDK setup didn't support the HTC EVO natively.
**couldn't post url so google "FYI EVO/Incredible ADB How-To - Android Developers | Google Groups" and open the first link **
forceOnature said:
I just installed ADB USB driver, and I had to use the tip found below because the driver downloaded by the SDK setup didn't support the HTC EVO natively.
**couldn't post url so google "FYI EVO/Incredible ADB How-To - Android Developers | Google Groups" and open the first link **
Click to expand...
Click to collapse
what version of windows are you using?
is this the correct link? http://groups.google.com/group/andr...4a2ddfef884?show_docid=649444a2ddfef884&pli=1
joeykrim said:
Feel free to contribute - Creating this at toast's request
Will do my best to update this with everybody's experience and knowledge to help out the new comers. Welcome to the world of Android!!
1. Install Drivers
Win 7 drivers - http://depositfiles.com/en/files/yd61xorii - thanks shep211
Win XP drivers -
Win Vista drivers -
Click to expand...
Click to collapse
anyone using a REAL version of windows (Win7 64bit) will need these drivers... pulled from the SDK autodownloader... was a ***** to find... prob need to disable sign enforcement... mine is. when asked which of the 3 to select press the first Android ADB Interface.
yea your welcome...
That file doesn't work for me :-(
It just says that it can't install the drivers when I try to update/reinstall driver for the device "ADB" in device manager. I have tried the drivers from the SDK, the set in the post from the OP and the one a couple posts above me. What gives?

[Completed] How do you change the default Android app installation directory

I am currently using guides which utilize android sdk (adb) to change Android's default installation directory. (I can't link the guides i'm using because new users can't seem to post links) The instructions say that I need to:
install Java Development Kit
install Android SDK
activate Developer Options for the android device
open Command Prompt with Administrator privileges
open "...android-sdk\platform-tools" installation directory (for me it was "C:\Users\...\AppData\Local\Android\android-sdk\platform-tools")
hold SHIFT and right-click anywhere on the folder
select "Open command window here"
type in
Code:
adb devices
type in
Code:
adb shell pm setInstallLocation 2
close Command Prompt
With these steps, apparently I should be able to use my SD card as my device's default installation directory. I need to do this because this tablet does not have a lot of space to download apps onto.
Brand/Model: MJS T2702
Android Version: 5.1.1 Lollipop
Internal Memory: 8GB
External Memory: 128GB
My problem is that as I follow these directions, when I get to the part of identifying the android devices in CMD (the "adb devices" step), I cannot find any devices. Nothing shows up. Has anyone tried this technique before? I don't know what i'm doing wrong. I have tried the same instructions on my Motorola Moto E and Nexus 7 (2012) but CMD doesn't seem to identify my android devices connected. All three devices are running the same version of Android.
Hi,
Try posting your question here:
Android Q&A, Help & Troubleshooting
The experts there may be able to help.
Good luck!

[GUIDE]List all installed apps that don't allow adb backup

Some apps can't be backed up using adb backup. It is mainly because on its AndroidManifest.xml the flag android:allowBackup is either not set or set to "false". This tutorial will get you a list of apps that are currently installed on your device but will not be backed up, either using the official adb backup, LG Backup, Sony Backup and Restore, etc. (because they all use adb backup internally). So you can be cautious on advance and you are aware that the backup methods used officially have its flaws.
1) REQUIREMENTS
I will make the list of apps using a computer, so you need several things set up on the computer and the android phone.
1.1) SMARTPHONE REQUIREMENTS
-> USB Debugging enabled: How to enable USB Debugging on Android [Youtube]
1.2) COMPUTER REQUIREMENTS
-> aapt.exe and adb.exe installed. I recommend to install the Android Studio Bundle. The binaries will be installed in a path similar to this:
Code:
C:\Users\YourUser\AppData\Local\Android\sdk\build-tools\24.0.3\aapt.exe
Code:
C:\Users\YourUser\AppData\Local\Android\sdk\platform-tools\adb.exe
-> Add the paths of aapt.exe and adb.exe to your current PATH in Windows: How to Edit Your System PATH for Easy Command Line Access in Windows
-> Cygwin is mandatory to run bash commands on Windows. The x86 version is recommended because it has more commands than the 64bit version. This is where you will actually type the commands.
-> adb drivers for your smartphone. Windows 10 usually will install them flawlessly.
2) GETTING THE LIST OF APPS THAT DON'T ALLOW ADB BACKUP
2.2) CHECKING FOR SOFTWARE AND SMARTPHONE
Go into cygwin to a working directory to store there your temporary files:
Code:
cd /cygdrive/c/Temp/
Check with Cygwin that you PATH is currently set and that adb.exe and aapt.exe are usable:
Code:
which adb
/cygdrive/c/Users/Admin/AppData/Local/Android/sdk/platform-tools/adb
which aapt
/cygdrive/c/Users/Admin/AppData/Local/Android/sdk/build-tools/24.0.3/aapt
Now connect your android smartphone to the computer with the screen unlocked, accept any data connection (use MTP method if asked or from notifications panel), authorize the computer and run on Cygwin:
Code:
adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
LGH815b4b2c42e unauthorized
adb devices
List of devices attached
LGH815b4b2c42e device
2.3) GETTING THE LIST OF ALL APPS ON THE DEVICE
On this step, a list of all apps on the smartphone, will be saved to a file called all_packages.txt in the format of package name. That string that appears at the end of the url when you browse an app on the Play Store.
Code:
adb shell pm list packages | grep -v '^$' > all_packages.txt
UNDER CONSTRUCTION. WILL REPLY WHEN FINISHED. SUBSCRIBE IF YOU ARE INSTERESTED
It looks like somebody released an application for that and works great:
No ADB backup app lister

Computer Setup for executing fastboot commands

Credits : XDA developers
This is not my work I just make all of them at one place
Procedure for making your computer ready for executing fastboot commands
1 ) Install ADB drivers in windows using below link
https://drive.google.com/file/d/1lZ2pZLne6TV9YJLmS9P_EAteuAZn_BPs/view?usp=drivesdk
2) Download platform tools below link for windows :
https://drive.google.com/file/d/1HUAUNJnlOKUJCxSqVxNVRagV4XBGe-2Q/view?usp=drivesdk
linux and mac users download platform tools from this link :
https://developer.android.com/studio/releases/platform-tools.html
2 ) extract it
‎
‎3) whenever you want use fastboot commands
Goto platform tools and paste required file in platform tools folder
4) then from platform tools folder open Power shell or command prompt using (shift + right click ) in empty space
Then it will open command promt then you can execute fastboot commands
That's it now your computer can be used for executing fastboot commands
On Linux, you can type "whereis adb" to find the location, and then "sudo cp adb fastboot location(usually /usr/bin)", to replace it and use it system wide. Afterwards, always check "adb version", to make sure you did it right.
Sent from my Mi A1 using Tapatalk
Harris P said:
On Linux, you can type "whereis adb" to find the location, and then "sudo cp adb fastboot location(usually /usr/bin)", to replace it and use it system wide. Afterwards, always check "adb version", to make sure you did it right.
Click to expand...
Click to collapse
Thanks for the information
I only know about windows OS
Easier method for installing adb and fastboot in Ubuntu
For those running recent Ubuntu versions or distributions based on them, there are packages for adb and fastboot available in the default repositories. To install them, execute this command in the terminal:
Code:
sudo apt install android-tools-adb android-tools-fastboot
Addendum: This works on all Ubuntu versions from 16.04 and beyond. I haven't tested this on the 14.10, 15.04, and 15.10 releases. However, I can confirm that this doesn't work on 14.04 and below.

Platform-tools problems

can anyone help? I use platform-tools and it's not connecting I hope there is a solution here
The so-called Platform Tools contain among others the 2 programs/drivers ADB and Fastboot
Only to clarify things:
ADB
is a protocol that allows you to communicate with an Android device that got booted, means its main Android OS is running
At Windows command prompt you enter commands - one by one -
Code:
adb devices
adb <ANY_SUPPORTED_ADB_SUBCOMMAND>
FASTBOOT
is a program used to manipulate (list, install, erase) the non-volatile memory such as flash filesystem partitions on devices that adhere to the fastboot protocol, via a USB connection from a host computer. It requires that the device be started in a boot loader mode with the fastboot protocol enabled.
IMPORTANT: Fastboot will only work if the OEM/Carrier has included support for the Fastboot protocol.
At Windows command prompt you enter commands - one by one -
Code:
adb devices
adb reboot bootloader
fastboot devices
fastboot <ANY_SUPPORTED_FASTBOOT_SUBCOMMAND>
Andika_Achmad said:
can anyone help? I use platform-tools and it's not connecting I hope there is a solution here
Click to expand...
Click to collapse
Plateform-tools are command line tools coming with the android sdk. As the build-tools, plateform tools are command line tools, so to use them you shall first know how to use them.
Here's the usage of some command-line tool available in the Android Sdk:
Command-line tools | Android Studio | Android Developers
Find out about the most important command-line tools that are available, organized by the packages in which they're delivered.
developer.android.com
Here's the content of /plateform-tools:
adb
api (a folder)
dmtracedump
e2fsdroid
etc1tool
fastboot
lib64 (a folder)
hprof-conv
make_f2fs
make_f2fs_casefold
mke2fs
mke2fs.conf
NOTICE.txt
package.xml
sload_f2fs
source.properties
sqlite3
systrace (a folder)

Categories

Resources