Ubuntu Touch Porting: Motorola Moto E 2015 4G/LTE - E 2015 Android Development

ATTENTION:
Code:
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards, the expulsion of some contestant at the Spanish version of Got Talent,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
THIS WILL WIPE ENTIRELY YOUR DEVICE. YOU WILL NEED TO CHANGE THE FILE SYSTEM OF /DATA TO EXT4 FROM F2FS IN TWRP BEFORE ANYTHING ELSE. AND, IT IS A MUST REQUIREMENT DOING A NANDROID OF YOUR CURRENT ROM WITH TWRP: TWRP Home >> Wipe >> Advanced Wipe >> tick data >> Repair or Change File System >> Change File System >> EXT4 >> Swipe to change.
UPDATE 22/07/2021: It has been discovered that some American surnia units (with model code XT1526 and XT1527, sold on Sprint and AT&T carriers) have different partition table than the European or Global versions (XT1521 and XT 1524). Sprint and AT&T surnia models are NOT COMPATIBLE with UBPorts, and trying to do this steps will cause a bootloop (easily fixable with a reflashing of LineageOS/stock ROM).
Hello. I'm a developer from Spain and I'm doing a porting work on my Moto E 2015 in Halium and Ubuntu Touch, and I'm looking for testers with surnia (CAUTION: ONLY surnia is allowed in this, NOT otus, sorry for this, I don't have otus) for testing this compilated version of Halium and Ubuntu Touch, because I'm having trouble with the port (rootfs not flashing on /data properly). I have some instructions to test this, and files to download and test on a real device.
-INSTRUCTIONS (only with Ubuntu Linux):
1-Download halium-boot (https://mega.nz/file/6TRRgAAa#YjtJ35nXxIMS_tVyaURRHuJfvjx3mxLFY1H6WWzD_Z4). Boot in Recovery Mode and flash with:
Code:
fastboot flash boot /path-to the image of halium-boot/halium-boot.img
2-Download system.img and halium-install.zip
https://mega.nz/file/GXBVAQyA#w68fYNKZ3He4Zg69QC9bkvQI8702ZAho4M4TVmKdfxg
https://github.com/JBBgameich/halium-install/archive/master.zip
Uncompress halium-install.zip and get into the folder via Terminal.
3-Download the latest rootfs from UBPorts:
https://ci.ubports.com/job/xenial-r.../out/ubports-touch.rootfs-xenial-armhf.tar.gz
4-Boot into TWRP recovery (or your recovery with BusyBox) and run this command (in the folder halium-install):
Code:
halium-install.sh -p ut -v path/to/rootfs.tar.gz path/to/system.img
Put a password that you can remember when prompted.
Wait, and it should flash all succesfully, if all goes well. I do not guarantee the success in this (my device has a problem with /data partition), so I need all the feedback possible in this (Terminal logs, for example, would be useful to me).
5-Reboot. Now, it should be the phone on Bootloader screen, but if you text in a terminal
Code:
ssh [email protected]
It should ask for a password and load the rootfs successfully.
After that, with this settings:
Code:
sudo mount -o remount,rw /
and
Code:
sudo -i # And enter your password
cat /var/lib/lxc/android/rootfs/ueventd*.rc|grep ^/dev|sed -e 's/^/dev///'|awk '{printf "ACTION=="add", KERNEL=="%s", OWNER="%s", GROUP="%s", MODE="%s"n",$1,$3,$4,$2}' | sed -e 's/r//' >/usr/lib/lxc-android-config/70-[codename].rules
and, finally, rebooting the phone, it should boot Ubuntu Touch. The lock password is the same than the password you made before in the install.
I need feedback to do this well. Any comments on this will be welcomed.
Logo of the project licensed by UBPorts by Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License.
XDA:DevDB Information
Ubuntu Touch Porting: Motorola Moto E 2015 4G/LTE, ROM for the Moto E 2015
Contributors
impreza233, bartbart2003
Source Code: https://github.com/Halium/projectmanagement/issues/97
ROM OS Version: 7.x Nougat
ROM Kernel: Linux 3.10.x
ROM Firmware Required: Unlocked bootloader, latest TWRP or custom recovery with BusyBox installed
Version Information
Status: Alpha
Created 2018-09-29
Last Updated 2020-09-20

Great job!

Buen trabajo! Quizás lo testee más tarde, cuando esté seguro de que no necesitaré el celular para algo importante jajajaj.
~~
For English readers:
Great job! I may test it later, when I'm sure I won't be needing the phone for something important haha.

impreza233 said:
4-Boot into TWRP recovery (or your recovery with BusyBox) and run this command (in the folder halium-install):
Code:
halium-install-standalone.sh -p ut -v path/to/rootfs.tar.gz path/to/system.img
Click to expand...
Click to collapse
The file halium-install-standalone.sh is not existant. Tried using halium-install and /utils/standalone.sh, but both are giving me a "Permission denied" dialog. SU not found, using Squid's TWRP.

SonicoXD said:
The file halium-install-standalone.sh is not existant. Tried using halium-install and /utils/standalone.sh, but both are giving me a "Permission denied" dialog. SU not found, using Squid's TWRP.
Click to expand...
Click to collapse
Yes, it's a little fail on my install tutorial. The file is named halium-install.sh. utils/standalone.sh won't do nothing. I will fix this error in the tutorial. Thanks for the tip!!!
Otherwise, what version of Squid's TWRP do you use? I use the latest version from here: https://eu.dl.twrp.me/surnia/ and no problems on my side. I will investigate this too.
EDIT: fixed error on the install tutorial.

sh:halium-install.sh not found (twrp 3.2.3)

Android-fan117 said:
sh:halium-install.sh not found (twrp 3.2.3)
Click to expand...
Click to collapse
If you are inside the folder of halium-install.sh, when you have to type the command halium-install.sh, drag and drop the .sh file to the terminal, in this way:
path/to/halium-install.sh -p ut -v path/to/rootfs.tar.gz path/to/system.img
EDIT: fixed on the main tutorial.

ok... all flashed just fine,but ssh [email protected] gives Connection timed out (new network connection appears,when phone boots).I just can`t connect.

Android-fan117 said:
ok... all flashed just fine,but ssh [email protected] gives Connection timed out (new network connection appears,when phone boots).I just can`t connect.
Click to expand...
Click to collapse
Well, this is a good signal
What do you get if you do this command?:
Code:
ssh -vvvv [email protected]
I need to know that messages to debug this.

impreza233 said:
Well, this is a good signal
What do you get if you do this command?:
Code:
ssh -vvvv [email protected]
I need to know that messages to debug this.
Click to expand...
Click to collapse
I get this:
openSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "10.15.19.82" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.15.19.82 [10.15.19.82] port 22.
debug1: connect to address 10.15.19.82 port 22: Connection timed out
ssh: connect to host 10.15.19.82 port 22: Connection timed out
(But new network connection appears)
ALSO I saw some errors while installing:
I: Pushing rootfs and android image to /data via ADB
5528 KB/s (2147483648 bytes in 379.315s)
5243 KB/s (1895825408 bytes in 353.069s)
Installing udev rules
cannot stat './file/70-tenshi.rules': No such file or directory
cannot stat './file/70-tenshi.rules': No such file or directory
cannot stat './file/70-tenshi.rules': No such file or directory

Android-fan117 said:
I get this:
openSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "10.15.19.82" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.15.19.82 [10.15.19.82] port 22.
debug1: connect to address 10.15.19.82 port 22: Connection timed out
ssh: connect to host 10.15.19.82 port 22: Connection timed out
(But new network connection appears)
ALSO I saw some errors while installing:
I: Pushing rootfs and android image to /data via ADB
5528 KB/s (2147483648 bytes in 379.315s)
5243 KB/s (1895825408 bytes in 353.069s)
Installing udev rules
cannot stat './file/70-tenshi.rules': No such file or directory
cannot stat './file/70-tenshi.rules': No such file or directory
cannot stat './file/70-tenshi.rules': No such file or directory
Click to expand...
Click to collapse
Well, it means that the flashing of rootfs has been sucessful. Yipeee!!!! Well, the tenshi thing will be removed in future versions of the script. It was here only for debugging purposes.
For the ssh thing, I will provide a patch for that. Thanks again for your feedback!!!

impreza233 said:
Well, it means that the flashing of rootfs has been sucessful. Yipeee!!!! Well, the tenshi thing will be removed in future versions of the script. It was here only for debugging purposes.
For the ssh thing, I will provide a patch for that. Thanks again for your feedback!!!
Click to expand...
Click to collapse
Ok. Just let me know,when all be done. I'll test it again.

Android-fan117 said:
Ok. Just let me know,when all be done. I'll test it again.
Click to expand...
Click to collapse
Thanks for being the test case!

Android-fan117 said:
Ok. Just let me know,when all be done. I'll test it again.
Click to expand...
Click to collapse
Well, I have news. When you finish the halium-install process unpack and run the file attached to this message and remember to run the command to cancel previous connection with 10.15.19.82 in case of your ssh needs to. At that point it should be a connection to ssh.

impreza233 said:
Well, I have news. When you finish the halium-install process unpack and run the file attached to this message and remember to run the command to cancel previous connection with 10.15.19.82 in case of your ssh needs to. At that point it should be a connection to ssh.
Click to expand...
Click to collapse
get this(when run ssh_connection.sh):
* The device seems to be connected as enp0s20u7
RTNETLINK answers: File exists
RTNETLINK answers: File exists
PING 10.15.19.82 (10.15.19.82) 56(84) bytes of data.
From 192.168.2.89 icmp_seq=1 Destination Host Unreachable
From 192.168.2.89 icmp_seq=2 Destination Host Unreachable
From 192.168.2.89 icmp_seq=3 Destination Host Unreachable
--- 10.15.19.82 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2038ms
pipe 3
* Connecting using ssh
OpenSSH_7.2p2 Ubuntu-4ubuntu2.5, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 10.15.19.82 [10.15.19.82] port 22.
debug1: connect to address 10.15.19.82 port 22: No route to host
ssh: connect to host 10.15.19.82 port 22: No route to host

Android-fan117 said:
get this(when run ssh_connection.sh):
* The device seems to be connected as enp0s20u7
PING 10.15.19.82 (10.15.19.82) 56(84) bytes of data.
From 192.168.2.63 icmp_seq=1 Destination Host Unreachable
From 192.168.2.63 icmp_seq=2 Destination Host Unreachable
From 192.168.2.63 icmp_seq=3 Destination Host Unreachable
--- 10.15.19.82 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2052ms
pipe 3
* Connecting using ssh
OpenSSH_7.2p2 Ubuntu-4ubuntu2.5, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 10.15.19.82 [10.15.19.82] port 22.
debug1: connect to address 10.15.19.82 port 22: No route to host
ssh: connect to host 10.15.19.82 port 22: No route to host
Click to expand...
Click to collapse
Don't worry. I will continue tuning it for best results. My result is the same as you.

impreza233 said:
Don't worry. I will continue tuning it for best results. My result is the same as you.
Click to expand...
Click to collapse
Ok.I`ll be waiting for this.

Android-fan117 said:
Ok.I`ll be waiting for this.
Click to expand...
Click to collapse
I'm thinking about the fact that the system would not be properly booted when the phone is switched on. Could you do a dmesg -w when the phone is switched on and shows a network on your computer?

impreza233 said:
I'm thinking about the fact that the system would not be properly booted when the phone is switched on. Could you do a dmesg -w when the phone is switched on and shows a network on your computer?
Click to expand...
Click to collapse
I`ll do it right now
---------- Post added at 04:20 PM ---------- Previous post was at 04:04 PM ----------
impreza233 said:
I'm thinking about the fact that the system would not be properly booted when the phone is switched on. Could you do a dmesg -w when the phone is switched on and shows a network on your computer?
Click to expand...
Click to collapse
ok...I found this
[ 1373.515554] usb 3-7: New USB device found, idVendor=18d1, idProduct=d001
[ 1373.515560] usb 3-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1373.515564] usb 3-7: Product: Failed to boot
[ 1373.515568] usb 3-7: Manufacturer: Halium initrd
[ 1373.515571] usb 3-7: SerialNumber: halium-initrd telnet 192.168.2.15

Android-fan117 said:
I`ll do it right now
---------- Post added at 04:20 PM ---------- Previous post was at 04:04 PM ----------
ok...I found this
[ 1373.515554] usb 3-7: New USB device found, idVendor=18d1, idProduct=d001
[ 1373.515560] usb 3-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1373.515564] usb 3-7: Product: Failed to boot
[ 1373.515568] usb 3-7: Manufacturer: Halium initrd
[ 1373.515571] usb 3-7: SerialNumber: halium-initrd telnet 192.168.2.15
Click to expand...
Click to collapse
Just as I suspected. Halium fails to boot. I will continue investigating this. Thanks!!!

Related

I can't get adb.exe to run.

Guys I cant run adb.exe (in c/android/android-sdk/platform-tools/adb)
When I clicking it's opening (I see some txts scrolling there) and after 2 sec adb window closed !
I instal java, motorola driver.
So I try another PC, but samething...
I just whant to use simple commands like a:
adb reboot bootloader
fastboot oem unlock
fastboot reboot
.....yes just want to root and unlock bootloader...
People can you tell me what im doing wrong ?
I post a video so you will see also.
http://www.youtube.com/watch?v=fhcKYwcHltA
Thank you for help. (I already know who will help me for sure thank you okantomi)
Best regards !
avetny said:
Guys I cant run adb.exe (in c/android/android-sdk/platform-tools/adb)
When I clicking it's opening (I see some txts scrolling there) and after 2 sec adb window closed !
I instal java, motorola driver.
So I try another PC, but samething...
I just whant to use simple commands like a:
adb reboot bootloader
fastboot oem unlock
fastboot reboot
.....yes just want to root and unlock bootloader...
People can you tell me what im doing wrong ?
I post a video so you will see also.
http://www.youtube.com/watch?v=fhcKYwcHltA
Thank you for help. (I already know who will help me for sure thank you okantomi)
Best regards !
Click to expand...
Click to collapse
Now you got me under your spell, lol.
I'm assuming that you're following this guide: http://forum.xda-developers.com/showthread.php?t=1249798
If so, go back over it, step by step. If you are still having problems, and if noone else jumps in, I'll come back later and try to help. I'm in transit right now.
I know you can do this...just take your time.
you don't use a adb.exe from the windows GUI. Its used in the terminal (cmd). That's why it goes away really fast when you try to click on it.
If you cd to the place where adb is and type in adb.exe you will get that same text window, but it will stay up. You can then read it and see the different commands that are included in adb. Do your research first. Learn how to use adb from any of the HUNDREDS of tutorials here on xda or google
okantomi said:
Now you got me under your spell, lol.
I'm assuming that you're following this guide: http://forum.xda-developers.com/showthread.php?t=1249798
If so, go back over it, step by step. If you are still having problems, and if noone else jumps in, I'll come back later and try to help. I'm in transit right now.
I know you can do this...just take your time.
Click to expand...
Click to collapse
thank you guys !!! thanks a lot I will try.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Petros>adb.exe
'adb.exe' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Petros>C:\android\android-sdk\platform-tools\adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
this is what I got
GOT IT !!! GOT IT GUYS
Thank u know im working on it !!! <3
best regards !!
okantomi said:
Now you got me under your spell, lol.
I'm assuming that you're following this guide: http://forum.xda-developers.com/showthread.php?t=1249798
If so, go back over it, step by step. If you are still having problems, and if noone else jumps in, I'll come back later and try to help. I'm in transit right now.
I know you can do this...just take your time.
Click to expand...
Click to collapse
Okantomi you know this command is working:
adb reboot bootloader,
but after when I type: fastboot oem unlock, he telling:
'fastboot' is not recognized an internal or external command, operable program or batch file.
guys I fixed !!!
avetny said:
guys I fixed !!!
Click to expand...
Click to collapse
Fantastic! I knew it!
Thanks to kenfly for his help in getting you on the right track.
okantomi said:
Fantastic! I knew it!
Thanks to kenfly for his help in getting you on the right track.
Click to expand...
Click to collapse
People like you making xda-developers.com much more nicely and friendly.
Thank you my friend.
Best regards!
adb not working
avetny said:
thank you guys !!! thanks a lot I will try.
Click to expand...
Click to collapse
Hi i got my adb.exe working
Just locate ur adb.exe and copy the path.
Example
cd C:\Program Files\Android\android-sdk\platform-tools
Press enter.
Then type adb.exe
Done ur in
Hope this helps

[GUIDE] Changing your WIFI/Bluetooth MAC address

Hi All
In my quest of trying to restore my phone to its original state after a hard-brick resurrection, I came up with a procedure to restore/change the WIFI-BT mac addresses.
So hoping that it could be helpful to the community, I'm sharing it with you.
I'm also writing a post about my investigations concerning the Radio/WLAN low level configuration.
As soon as it is ready I'll add a link here, so if you're willing to help or if you're interested in my investigations, stay tuned !!!
1. Prerequisite:
- Rooted and S-OFF Desire S
- USB Debug must be enabled on the phone
- Fast Boot must be disabled on the phone
- Android tools installed (look for tutorial in this forum on how to install them.)
- I assume that you already know how to use the android tools.
2. Disclaimer
- I decline all responsibilities for bricked phone and such.
- You're using this procedure at your own risk.
3. The Theory:
The Radio/WLAN configuration is stored in the mmcblk0p23 partition.
3.a. Changing the WIFI MAC address.
The WIFI configuration is located at the beginning of the partition:
Offset 0x0000000C : the length of the wifi configuration file. (2 bytes little-endian)
Offset 0x00000010 : 32bits CRC checksum of the wifi configuration file
Offset 0x00000040 : the actual wifi configuration file.
Offset 0x000110CC : the wifi mac address (Only informative - not used by the system).
The WIFI configuration "file" contains the MAC address along with other configuration parameters. And these other parameters depends on the revision of your phone's motherboard (and maybe other parameters as well)
The integrity of this "file" is also protected by the CRC checksum located at offset 0x00000010.
So you cannot just change the MAC address in this file as HBOOT will detect it at boot time and restore a "factory" default configuration.
The trick is to have HBOOT restore a "factory" default configuration with the MAC address you want to use.
For this, you should look in the HBOOT partition (mmcblk0p18) and find the "factory" default configuration that EXACTLY match the file of your Radio/WLAN partition (except for the mac address).
BE SURE TO FIND THE CORRECT ONE as the HBOOT partition contains several "factory" default configuration for the various motherboard revisions.
Then change the MAC address of this "factory" configuration file (which should be 00:11:22:33:44:55 if you never modified it).
Then you should alter the configuration file in the Radio/WLAN partition (change the mac address for example) so that the CRC checksum will fail and so that HBOOT will restore the new "factory" default configuration (with your new MAC address) during next reboot.
For consistency, you should also change the MAC address at offset 0x000110CC. (All the information contained at offset 0x00011000 seems to be only informative).
3.b Changing the Bluetooth MAC address.
The BT configuration is much more simple (no CRC or other parameters...)
Offset 0X00006000 : BT mac address (binary format !)
Offset 0x000110BC : the BT mac address (Only informative - not used by the system).
So you just need to put your new BT MAC address at this two offsets
4. The quick procedure...
- download the wlan_config tool I wrote
- open a command line console
- cd into the directory where you've put the wlan_config tool
- Then type:
Code:
> adb push wlan_config /data/local/tmp/
> adb shell chmod 777 /data/local/tmp/wlan_config
> adb shell /data/local/tmp/wlan_config --dry-run wf=<the new WIFI macaddr> bt=<the new BT macaddr>
******************************************************************************
***** HTC Desire S WLAN Configuration tool 1.0 by RXBoucher... *****
******************************************************************************
[!] **************************************************************************
[!] >>>>>> dry-run mode: no change will be made to partitions <<<<<<
[!] **************************************************************************
[*] **************************************************************************
[+] Reading partition(s)
[+] partition mmcblk0p23....................................................OK
[+] partition mmcblk0p18....................................................OK
[*] **************************************************************************
[+] Analyzing partition mmcblk0p23...
[+] ModelID : PG8810000
[+] Current WIFI mac address: 7C:61:--:--:--:--
[+] Current BT mac address: 7C:61:--:--:--:--
[*] **************************************************************************
[+] Backing up partition(s)...
[!] partition mmcblk0p23...............................................SKIPPED
[!] partition mmcblk0p18...............................................SKIPPED
[*] **************************************************************************
[+] Configuring WIFI -> 7C:61:DD:DD:DD:DD
[+] Looking up matching "factory" default WIFI configuration................OK
[+] Updating "factory" default WIFI configuration...........................OK
[+] Updating WIFI configuration.............................................OK
[*] **************************************************************************
[+] Configuring BT -> 7C:61:FF:FF:FF:FF
[+] Updating BT mac address.................................................OK
[*] **************************************************************************
[+] Writing partitions...
[!] partition mmcblk0p23...............................................SKIPPED
[!] partition mmcblk0p18...............................................SKIPPED
[*] **************************************************************************
[!] dry-run successful...
This will run the wlan_config tool in dry-run mode (will not actually perform any changes to the partitions.)
If the dry-run mode is successful then you can re-run the command without the --dry-run option
Code:
>adb shell /data/local/tmp/wlan_config wf=<the new WIFI macaddr> bt=<the new BT macaddr>
******************************************************************************
***** HTC Desire S WLAN Configuration tool 1.0 by RXBoucher... ****
******************************************************************************
[+] Reading partition(s)
[+] Analysing partition mmcblk0p23...
[+] Backing up partition(s)...
[+] Configuring WIFI -> 7C:61:DD:DD:DD:DD
[+] Configuring BT -> 7C:61:FF:FF:FF:FF
[+] Writing partitions...
[!] WLAN configured...
[!] please reboot phone
Then you must reboot your phone and enjoy your new WLAN configuration.
If the dry-run mode fails, it means that the tool was unable to find where or how to change the WLAN configuration.
In this case, maybe you should read the Long Procedure and try to perform the changes manually.
If you want to see the various options and parameters of the wlan_config tool
Code:
> adb shell /data/local/tmp/wlan_config --help
******************************************************************************
***** HTC Desire S WLAN Configuration tool 1.0 by RXBoucher... ****
******************************************************************************
USAGE:
wlan_config [OPTIONS] <PARAMETERS>
OPTIONS:
-d, --dry-run : test mode. The configuration tool will be run without
actually modifying partition(s)
-v : verbose mode. The configuration tool will output more
detailed information.
Can be added several times to increase verbosity
--help : display this usage message.
PARAMETERS:
wf=<macaddr>: the configuration tool will change the WIFI mac address
bt=<macaddr>: the configuration tool will change the BT mac address
with <macaddr>=XX:XX:XX:XX:XX:XX
5. The long procedure (manual)
Connect your phone to your PC using the Charger Only option.
Then open a command line console and dump the mmcblk0p18 (HBOOT) and the mmcblk0p23 (wlan/radio config) partitions:
Code:
>adb shell dd if=/dev/block/mmcblk0p18 of=/sdcard/mmcblk0p18.img
>adb shell dd if=/dev/blocl/mmcblk0p23 of=/sdcard/mmcblk0p23.img
>adb pull /sdcard/mmcblk0p18.img
>adb pull /sdcard/mmcblk0p23.img
>copy mmcblk0p18.img mmcblk0p18-org.img
>copy mmcblk0p23.img mmcblk0p23-org.img
You should keep the "org" files safe in case you need to restore them.
Now we're going to edit/modify the 2 files mmclkk0p18.img and mmcblk0p23.img with HexEdit:
- Go in the mmcblk0p23.img tab
- Select, in the Hex View (not Text View), everything starting at offset 0x0000005B (sromrev=) up to the last 0D 0A 00
- Copy it to clipboard (Ctrl+C)
- Go in the mmcblk0p18.img tab
- Open the search dialog box (Ctrl+F)
- In the "Search For" text field, paste the clipboard (Ctrl+F)
- In the "Datatype" drop down list select "Hex-values"
- Click OK
HedEdit should then find and highlight the corresponding match.
Just before the highlighted selection, you should have the factory default MAC address: macaddr=00:11:22:33:44:55
-Change this MAC address with the one you want to use (in the text-view)
-Save the file (Ctrl+S)
-Go back to the mmcblk0p23.img tab
-Put the new MAC address at offset 0x00000048 (in the text-view)
-Go to offset 0x000110CC (Ctrl+G)
-Put your WIFI MAC address here also (in the text-view)
-Go to offset 0x00006000
-In the hex-view type in you're new BT MAC address
-Got to offset 0x000110BC
-Put your BT MAC Address here to (in the text-xiew)
Save the file.
You're done with the editing.
You should now replace your partitions with the modified images.
Go back to your command line console then type:
Code:
>adb push mmcblk0p23.img /data/local/tmp/mmcblk0p23.img
>adb push mmcblk0p18.img /data/local/tmp/mmcblk0p18.img
>adb shell dd if=/data/local/tmp/mmcblk0p23.img of=/dev/block/mmcblk0p23
>adb shell dd if=/data/local/tmp/mmcblk0p18.img of=/dev/block/mmcblk0p18
Reboot your phone and enjoy your new WLAN configuration !!!
Can i use it for Desire
hi....
Can i use this method for htc desire
my desire has no bleutooth and wifi mac address...
i uses usb bricked method but all in vain.... sam problem...
could you please tell me how can i write mac addresses in htc desire...i have rooted and cm7 rom is installed
bootloader is cm7r2
i also tried radio update...
sorry for bad english...
Please help me thx....
Hi, thanks for this great tool!
I'm getting this error:
error: Android 5.0 and later only support position-independent executables (-fPIE)

I have a One Mini, help needed.

Hello there people,
I am lucky enough to be in possession of a newly un-released HTC One Mini (proof seen below).
I am your loyal servant so let's get this thing rooted. Tell me what to do and I will do anything I can to help. :good:
guywithdesire1992 said:
Hello there people,
I am lucky enough to be in possession of a newly un-released HTC One Mini (proof seen below).
I am your loyal servant so let's get this thing rooted. Tell me what to do and I will do anything I can to help. :good:
Click to expand...
Click to collapse
would you mind getting in touch with me so i can assist in full system dump
thanks bud
Check your PMs mate.
Sent from my Evita
timmaaa said:
Check your PMs mate.
Sent from my Evita
Click to expand...
Click to collapse
Yeah
Sent from my HTC One S using xda premium
https://github.com/zarboz/android_vendor_htc_m4
https://github.com/zarboz/android_device_htc_m4
Just need to grab his zImage and should be set
How u like that mini bro?
Sent from my HTC One XL using Tapatalk 4 Beta
Moved To Q&A​
Please do not open question threads in a dev section​
https://mega.co.nz/#!Q4Q2CIBY!bLmngjjawQueqw3_y_WTPl5BqGVChnIj2MHGXvPgQ6Q
HTC One mini dump
OP,
Could you run the following commands and then post the file and zip up the folder they make? (Run the first from terminal emulator, second from computer)
Single file (will be in sdcard)
Code:
dd if=/dev/block/mmcblk0p32 of=/sdcard/boot.img
Folder (will be on computer, zip up and upload please)
Code:
adb pull /data/preload
Sent from my buttered S3
CNexus said:
OP,
Could you run the following commands and then post the file and zip up the folder they make? (Run the first from terminal emulator, second from computer)
Single file (will be in sdcard)
Code:
dd if=/dev/block/mmcblk0p32 of=/sdcard/boot.img
Folder (will be on computer, zip up and upload please)
Code:
adb pull /data/preload
Sent from my buttered S3
Click to expand...
Click to collapse
the boot partition is read protected and so is /data without root
we need temp root to dump the boot partiion for me to build him a working recovery
CNexus said:
OP,
Could you run the following commands and then post the file and zip up the folder they make? (Run the first from terminal emulator, second from computer)
Single file (will be in sdcard)
Code:
dd if=/dev/block/mmcblk0p32 of=/sdcard/boot.img
Folder (will be on computer, zip up and upload please)
Code:
adb pull /data/preload
Sent from my buttered S3
Click to expand...
Click to collapse
Cannot run, permission denied.
C:\Users\Dan>cd c:\android
c:\android>dd if=/dev/block/mmcblk0p32 of=/sdcard/boot.img
'dd' is not recognized as an internal or external command,
operable program or batch file.
Click to expand...
Click to collapse
c:\android>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[email protected]:/ $ adb pull /data/preload
adb pull /data/preload
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
1|[email protected]:/ $ ^C
c:\android>adb pull/data/preload
Android Debug Bridge version 1.0.31
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <specific device> - directs command to the device or emulator with
the given
serial number or qualifier. Overrides ANDROID_S
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --
iv <hex-encoded iv>] <file>
- push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
('--algo', '--key', and '--iv' mean the file is
encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosy
stem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup
archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
c:\android>
Click to expand...
Click to collapse
You didn't type the second command correctly...there should be a space between "adb" and "/data/preload".
For the first command, run this instead (from your computer)
Code:
adb shell
dd if=/dev/block/mmcblk0p32 of=/sdcard/boot.img
exit
adb pull /sdcard/boot.img
And then upload the boot.img that should be in your current folder on your computer
If still nothing, please PM me so we can set up a team viewer and I can try to pull those files and I can also try to root your phone (safe, nothing bad will happen if it fails)
Sent from my buttered S3
Deodexed dump
Thank OP
http://www.androidfilehost.com/?fid=23060877489997282
Hi,
scine some days I own a htc one mini and I need to "root" it.
What is the best place to get started?
I'm very firm with linux, so I think i can do something
(I switched back from ios after some years of using iphone)
fvdaak said:
Hi,
scine some days I own a htc one mini and I need to "root" it.
What is the best place to get started?
I'm very firm with linux, so I think i can do something
(I switched back from ios after some years of using iphone)
Click to expand...
Click to collapse
PM me so we can set up teamviewer and try to root your phone
What's in it for me is that I really need the One mini's boot.img
CNexus said:
PM me so we can set up teamviewer and try to root your phone
What's in it for me is that I really need the One mini's boot.img
Click to expand...
Click to collapse
Would be great if you could get the recovery.img also.
Flyhalf205 said:
Would be great if you could get the recovery.img also.
Click to expand...
Click to collapse
If I can dump the boot.img then he can dev unlock and I'll pass him an insecure boot.img through which he can gain root.
Or if he gains root through another method, then we can still dump everything.
After that, life is good.
Anyway, still waiting for a response.
Hi,
I can confirm, what guywithdesire1992 said:
There is no permission to open the device.
When I do "dd if=/dev/block/mmcblk0p32 of=/sdcard/boot.img", I get the following error:
/dev/block/mmcblk0p32: cannot open for read: Permission denied
Do you have any suggestions?
btw:
There is no "su" on the device.
I've tried to install static linked su from "SuperUser.apk" and also from "CWM-SuperSU" - without success.
I have stored the su executables to /data/local/tmp and gained executable-rights (chmod 777). After that I was able to execute it, but i does nothing.
No error, just nothing
PM me so we can set up teamviewer and try to get you rooted.

[GUIDE] Huawei usb 3g modem on android x86 4.4.2

Finally found a way to get this usb 3g modem to work with android x86. Looks like there are significant differences in android kitkat, the other tutorials didn't work for me. Here's what i did in case somebody else finds it useful:
Model: Huawei E1752 HSPA USB Stick
Android x86 4.4.2 on Acer Netbook
Get modem to work under Ubuntu first so you have chat scripts that are known to work with your modem/provider. (If having trouble finding the right AT commands to initialize your modem you can record them under windows. Try free serial port monitor)
Install PPP Widget. It doesn't work, but that gives us usb_modeswitch and pppd to play with.
Install busybox if you don't have it already. Your device should be rooted.
I disabled modem's cdrom mode so that i wouldn't have to modeswitch it with PPP Widget every time (did it from linux)
http://ma.juii.net/blog/disable-usb-mode-switching
Tweak and install pppd/chat scripts for your provider:
/sdcard/pppwidget/ppp/free-chat
Chat script to initiate connection. Change AT commands and dial number (*99#) if yours differ.
Code:
ABORT BUSY
ABORT 'NO CARRIER'
ABORT 'NO ANSWER'
ABORT DELAYED
REPORT CONNECT
TIMEOUT 2
"" AT
OK-AT-OK AT&FE0V1X1&D2&C1S0=0
OK-AT-OK AT
OK-AT-OK ATS0=0
OK-AT-OK AT
OK-AT-OK AT&FE0V1X1&D2&C1S0=0
OK-AT-OK AT
OK ATDT*99#
TIMEOUT 30
CONNECT ''
SAY '\rReport from chat:\r'
/sdcard/pppwidget/ppp/peers/free
pppd config file
Code:
#/etc/ppp/peers/free
# Usage: root>pppd call free
ttyUSB0
3600000
crtscts
connect '/data/data/de.draisberghof.pppwidget/app_bin/chat -v -f /sdcard/pppwidget/ppp/free-chat'
noauth
defaultroute
usehostname
user fooooooo
noipdefault
usepeerdns
idle 0
/sdcard/3gmodem/connect
script to start connection
Code:
#!/system/bin/sh
pppd call free
# use own DNS (OpenDNS)
ndc resolver setifdns ppp0 208.67.222.222 208.67.222.220
ndc resolver setdefaultif ppp0
To connect, open a terminal and type:
Code:
$ su
# cd /sdcard/3gmodem
# ./connect
Now you're connected. browser should work now.
Connection is there but android doesn't know about it, so apps like play store which check connectivity will think you're offline. Install Fake Wifi Connection to deal with those.
Done !
how to get chat script for other modem
Hello, Can I use your chat script with Huawei E3531, and replace only the AT commands?
Do I need busybox?
I have no knowledge of commands, just very basic commands on android terminal.
I am having a really hard time to connect to internet, mainly because Broadcom BCM43142 wifi is not compatible with android 9.0-r2, and older versions.
Thank you

[GUIDE] Build / Mod AVD Kernel Android [10][11][12][13] rootAVD [Magisk] [USB passthrough] [Linux][Windows][MacOS] [Google Play Store API]

Hello Fellows,
with this Guide I would like to show what is necessary to do,
to get the new USB passthrough Feature,
from the Android Studio since Emulator 30.0.26 (August 16, 2020),
to work with a USB-Serial Device. Unfortunately the announcement "USB passthrough is now available"
needs to be taken literally. It means, just the passing from the host system to the gates of Android are possible.
There is no "taking it from there" implemented in Android nor the Kernel. And this is what this Guide is all about.
Inspired by Alabate and his Guide Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04
Three basic steps needed to be done.
[Update 04.05.2021]
Spoiler: Kernel Compilation
A much more easier and reliable way on how to build, mod and update your AVDs Kernel with its modules,
can be found in my [GUIDE] by using the official AOSP Build ENV.
Build the AVD Kernel with the right check at the right place
Convince Linux to actually let go of the USB-Serial Device
Grant Permissions in Android to acknowledge the new plugged in Device
The Development Environment:
Apple Macbook Pro 2011 Dualboot
USB-Serial Device Prolific PL2303 Serial Port
Linux Mint 20 Ulyana
Android Studio 4.1.1 (Software Manager)
KVM -> Cosmic (18.10) or later
Android emulator version 30.2.6.0 (build_id 6962233)
Google APIs Intel x86 Atom_64 System Image Android 10 API 29 (revision: 11)
miscellaneous
1. Build the AVD Kernel with the right check at the right place
### From the shell with the AVD running we can get some Kernel Infos:
uname -r && uname -v
4.14.175-g6f3fc9538452
#1 SMP PREEMPT Wed Apr 8 17:38:09 UTC 2020
### Install the following tools to work with and to build the kernel:
sudo apt-get install -y build-essential libssl-dev kernel-package libncurses5-dev bzip2 lib32z1 bison flex
sudo apt-get install -y libelf-dev libelf-devel or elfutils-libelf-dev
sudo apt-get install -y qt5-default qttools5-dev-tools qttools5-dev
sudo apt-get install -y geany git
### Create a working directory and download the kernel source and its prebuilt gcc:
I choose the latest android-10.0.0_r47 branch and its prebuilt gcc 4.9
Code:
cd ~/ && mkdir avdkernelcompile && cd avdkernelcompile
git clone \
-b android-10.0.0_r47 \
--single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
I also choose the mainline android-goldfish-4.14-dev branch from the goldfish kernel source
Code:
git clone -b android-goldfish-4.14-dev --single-branch https://android.googlesource.com/kernel/goldfish
### Pull the config.gz from the AVD to generate and merge the kernel defconfigs file:
These steps lower the risk of getting build errors. And before you mod the kernel, it could
make sense to start with a build kernel that actually boots your AVD first, and then apply changes to it.
Code:
adb pull /proc/config.gz
gunzip -k config.gz
cd goldfish
cp ../config .config
make savedefconfig
mv defconfig arch/x86/configs/avd_pulled_defconfig
rm .config
./scripts/kconfig/merge_config.sh -m \
./arch/x86/configs/avd_pulled_defconfig \
./arch/x86/configs/x86_64_ranchu_defconfig
make savedefconfig
mv defconfig arch/x86/configs/merged_avd_pulled_defconfig
rm .config
### prepare the kernel with the gcc to be build:
we are now in the goldfish directory
exports must be done every time you open a new terminal
export CROSS_COMPILE=x86_64-linux-android-
export ARCH=x86_64
export PATH=$PATH:$(pwd)/../x86_64-linux-android-4.9/bin
make the just created defconfig file
make merged_avd_pulled_defconfig
If you come back here later, this is the right place to mod your kernel.
I like the GUI Interface because you have a better overview and a search function.
make xconfig
In order to get the USB-Serial recognized by the kernel, make sure the UHCI HCD is checked.
You can find it under: Device Drivers -> USB support -> UHCI HCD (most Intel and VIA) support
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Close and save it.
### build the actually kernel, with the all CPU cores you have, and see afterwards how long it took:
time make -j$(nproc)
The new kernel is placed in:
~/avdkernelcompile/goldfish/arch/x86/boot/bzImage
We leave it there for now. If you are planing to make changes when all is working so far, just jump
to make xconfig . The build time now is much smaller now. If you have to start over,
you can run make mrproper
### Start the AVD with the new kernel from via terminal
To be able to start the emulator and adb from everywhere, add those path in your ~/.bashrc
echo export PATH=~/Android/Sdk/platform-tools:$PATH >> ~/.bashrc
echo export PATH=~/Android/Sdk/emulator:$PATH >> ~/.bashrc
source ~/.bashrc
run the new kernel with:
Code:
emulator \
-netdelay none -netspeed full -avd Pixel_4_XL_API_29 \
-writable-system -no-snapshot-load \
-show-kernel \
-verbose \
-ranchu \
-kernel ~/avdkernelcompile/goldfish/arch/x86/boot/bzImage
If the kernel works proper, you can run the AVD with this even after a Wipe Data from the AVD Manager
Later on, you can get rid of the show-kernel, verbose and ranchu option. If the kernel boots and you
can work with the AVD for your satisfaction, it is time for the mod and the next step.
2. Convince Linux to actually let go of the USB-Serial Device
According to the Emulator Release Notes, one would just need the vendorID and productID from the desired USB Device to pass it through. These are easily obtained by:
lsusb
Bus 002 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
To start the AVD with it, and you leave out the verbose stuff, the command changes to:
Code:
emulator \
-netdelay none -netspeed full -avd Pixel_4_XL_API_29 \
-writable-system \
-no-snapshot-load \
-kernel ~/avdkernelcompile/goldfish/arch/x86/boot/bzImage \
-qemu -usb \
-device usb-host,vendorid=0x067b,productid=0x2303
If you keep watching the terminal, you can see the error message:
libusb: error [get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/043, errno=13
libusb: error [get_usbfs_fd] libusb requires write access to USB device nodes
Now to convince Linux to let go of the USB-Serial Device, one must create an UDEV Rule.
You can do this even while the AVD is running an the USB-Serial Device is connected:
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", OWNER="libvirt-qemu", GROUP="kvm"' | sudo tee /etc/udev/rules.d/99-usb-android.rules
After this echo command, watch while you unplug and plug it, you will only see the Info Message:
libusb_release_interface: -4 [NO_DEVICE]
And if you also watching the AVD with:
adb root
adb shell
dmesg | grep usb
You will see that the kernel is already recognizing it.
[ 619.670306] usb 1-1: new full-speed USB device number 6 using uhci_hcd
[ 620.071451] usb 1-1: New USB device found, idVendor=067b, idProduct=2303
[ 620.073050] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 620.074698] usb 1-1: Product: USB-Serial Controller
[ 620.075872] usb 1-1: Manufacturer: Prolific Technology Inc.
Btw: If you also want to use this USB-Serial Device without access issues in other tools, for example CoolTerm,
just copy the line from the udev rule and change the SUBSYSTEM to tty.
SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", OWNER="libvirt-qemu", GROUP="kvm"
Side Note: Under Mac OS you will get a similar libusb: error, but unlike Linux, there is no UDEV System, so you
cannot change this situation at all. Also not by unloading a kext. I tried, even with EL Capitan where you actually
still could unload kexts very easily. So this just "prooves" that the Google Developers, never tried to pass an USB
through - even if they hinted it: (This should also have been workng on Linux and macOS already) And it is even
worst, there is actually a very convenient feature built in QEMU, with the -serial keyword, you can attach such devices
in no time. But for some reason, EXACTLY this feature is taken out from the Google Developers - what a bummer.
3. Grant Permissions in Android to acknowledge the new plugged in Device
With the kernel recognizing the USB-Serial Device and Linux let us acces it, the AVD just doesn't know what
to do with it. Or rather, it doesn't have permissions to proceed. To grant these permissions, one must simply
place a file, with this permissions, called android.hardware.usb.host.xml in /system/etc/permissions or
in /vendor/etc/permissions.
For both places we need not only root but also write access to it. Google Play AVD Images can be rooted, with my
rootAVD script, but these partitions can't remounted as writeable, no matter what. At least, not with my skills.
AVD Images with Google APIs on the other hand are capable of beeing rooted and writeable out of the box.
Actually, just the overlay paritions can be writeable. To achive this, one must start the AVD with the -writable-system
option. What we already doing all the time.
When the AVD is up, go with the ADB commands one by one:
adb root
adb shell avbctl disable-verification
adb disable-verity
adb reboot
adb root
adb remount
adb shell
Every command must show a positive result, if you stuck in a bootloop or so afterwards,
one of the two disable commands didn't work. Start over with a Wipe Data.
Once the remount command shows remount succeeded you are good to go.
In the adb shell:
echo '<permissions><feature name="android.hardware.usb.host"/></permissions>' > /system/etc/permissions/android.hardware.usb.host.xml
chmod 644 /system/etc/permissions/android.hardware.usb.host.xml
reboot
After the Reboot, plug in your USB-Serial Device, and If you have Serial USB Terminal installed.
it will finally pop up a message.
If you have USB Device Info installed, It will even show more informations.
If I disable USB Debugging, the 0000 Device will disappear.
That's it for now. The USB Passthrough for USB-Serial Devices can work.
I am currently working on a way to get a mass storage mounted in the AVD.
But I can't figure out the right fstab.ranchu entry for the AVD to auto mount my USB Storage.
I could get the kernel to recognize it:
[ 28.090063] usb 1-1: new full-speed USB device number 2 using uhci_hcd
[ 28.491686] usb 1-1: not running at top speed; connect to a high speed hub
[ 28.499738] usb 1-1: config 1 interface 0 altsetting 0 endpoint 0x2 has invalid maxpacket 512, setting to 64
[ 28.501413] usb 1-1: config 1 interface 0 altsetting 0 endpoint 0x81 has invalid maxpacket 512, setting to 64
[ 28.515287] usb 1-1: New USB device found, idVendor=1f75, idProduct=0917
[ 28.516925] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 28.518772] usb 1-1: Product: PenDrive
[ 28.519699] usb 1-1: Manufacturer: Innostor
[ 28.522417] usb 1-1: SerialNumber: 000000000000000071
[ 28.526804] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 28.528787] scsi host0: usb-storage 1-1:1.0
[ 29.962957] usb 1-1: reset full-speed USB device number 2 using uhci_hcd
But it keeps getting repeated with the last line
It also does show up as block device in:
brw------- 1 root root 8, 0 2021-01-03 23:49 sda
But without sda1, just sda. And the USB Stick was formated via SDCARDFS in a real phone.
Update 06.01.2021:
Modding the Kernel with USB Mass Storage and SCSI support
In order to get an USB Stick announced by the kernel as block device node, one must
activate some additional Supports in the Kernel Config.
Device Drivers
SCSI device support
SCSI device support
SCSI disk support
USB support
USB Mass Storage support
USB Attached SCSI
With these additional features, the kernel is providing the pluged USB Stick under
/dev/block/sd which is needed to get the fstab.ranchu able to pick it up.
Once the kernel is complete, one must tell Qemu where it is supposed to plug in the USB Stick.
This is done with the -device and USB type options:
Code:
-device usb-ehci,id=ehci \
-device usb-host,bus=ehci.0,vendorid=0x8564,productid=0x1000
The EHCI (USB 2.0) driver support is already build in the stock kernel, so if you device can be
"downsqeezed" you can tell it Qemu with these words. Use the device usb.ehci, identify it for me as ehci, and attach my VendorID and ProductID to your usb-host bus ehci.0
(ehci in qemu provides 8 USB ports) With this way, you can also attach multiply USB Devices to the same AVD.
Code:
-device usb-ehci,id=ehci \
-device usb-host,bus=ehci.0,vendorid=0x8564,productid=0x1000 \
-device usb-host,bus=ehci.0,vendorid=0x1f75,productid=0x0917
If you have added USB 3.0 support in your kernel already, you can even use the XHCI driver.
Code:
emulator \
-netdelay none -netspeed full -avd Pixel_4_XL_API_29 \
-writable-system -no-snapshot-load \
-kernel ~/avdkernelcompile/goldfish/arch/x86/boot/bzImage \
-qemu -usb \
-device usb-ehci,id=ehci \
-device usb-host,bus=ehci.0,vendorid=0x8564,productid=0x1000 \
-device qemu-xhci,id=xhci \
-device usb-host,bus=xhci.0,vendorid=0x1f75,productid=0x0917
And with the fstab.ranchu correctly tuned, both USB Stick will pop up systemwide for every app to use.
Spoiler: Root and fstab.ranchu
Modding the fstab.ranchu
Without Magisk on the AVD installed, you can very easly edit the
/vendor/etc/fstab.ranchu just in the adb remounted overlay partitions.
Add this line to it:
/devices/*/block/sd* auto auto defaults voldmanaged=usb:auto
With Magisk on the AVD installed, it gets messy. Due to the fact, that Magisk is mounting a mirror of the orignal read-only partitions, some changes can't be done like before. The only way I could figure out was
to add the fstab.ranchu in my ramdisk.img and let Magisk overlay it during boot time.
Root Directory Overlay System
For this you can use my script rootAVD.sh
Code:
# Set PATCHFSTAB=true if you want the RAMDISK merge your modded fstab.ranchu before Magisk Mirror gets mounted
PATCHFSTAB=false
#PATCHFSTAB=true
# cp the read-only fstab.ranchu from vendor partition and add usb:auto for SD devices
# kernel musst have Mass-Storage + SCSI Support enabled to create /dev/block/sd* nodes
...
How to root the AVD and patch fstab.ranchu:
The script runs in Linux, Darwin MacOS and Windows. It needs the path to the ramdisk.img of the system-image as a parameter.
The AVD needs to be running and accessible via adb shell.
Then just run it and restart, NOT adb reboot, your AVD. It works with
Android 7, Android 10 and Android 11. But not with Android 8 and Android 9.
It also copys every .apk within the Apps Folder to the AVD.
./rootAVD.sh ~/Android/Sdk/system-images/android-30/google_apis_playstore/x86_64/ramdisk.img
To get the fstab.ranchu patched, set PATCHFSTAB=true, make some adjustments, and let the rootAVD script run.
Miscellaneous:
Special Cherrys for Googe Play Store AVD with Stock Kernel:
The EHCI USB Driver is already implemented in the Stock Kernel, even in the Google Play Version AVD.
By adding the android.hardware.usb.host.xml file to its rightful place, a well
written App, like X-plore File Manager, could use its own USB-Driver to access the USB Storage.
But how to get it there? Once Magisk is installed via the rootAVD script. Which are basicly the
original scripts from Magisk, just a bit tuned. You can install my Magisk Module: usbhostpermissons
Don't forget to start the AVD with usb-ehci command. The USB Stick won't pop up systemwide,
but you can still use them within X-plore and copy & paste files with it.
Replace the emulator with a script to pass arguments and run it from the GUI:
Code:
mv ~/Android/Sdk/emulator/emulator ~/Android/Sdk/emulator/emulator-original
cat <<EOF > ~/Android/Sdk/emulator/emulator
#!/bin/bash
~/Android/Sdk/emulator/emulator-original \[email protected] \
-writable-system -no-snapshot-load \
-kernel ~/avdkernelcompile/goldfish/arch/x86/boot/bzImage \
-qemu -usb \
-device usb-ehci,id=ehci \
-device usb-host,bus=ehci.0,vendorid=0x8564,productid=0x1000 \
-device qemu-xhci,id=xhci \
-device usb-host,bus=xhci.0,vendorid=0x1f75,productid=0x0917 \
-device usb-host,bus=usb-bus.0,vendorid=0x067b,productid=0x2303
EOF
chmod +x ~/Android/Sdk/emulator/emulator
If you have your original emulator file renamed, don't forget to change it when you are
calling it manual from the command line.
[Update 15.12.2021]
Spoiler: For Windows Only.
Since Emulator Version 31.1.4, Google re-implemented the USB pass through feature along with
some tools:
prebuilt Windows drivers for USB passthrough
Downloadable directly from the AOSP by clicking the [tgz]
and emulator parameters:
-list-usb
-usb-passthrough
The Windows drivers must be installed from an Adminstrator Command Shell
Code:
Install_Drivers.bat
Installing Android USB Assistant...
call Android_USB_Assistant_Install.bat
Microsoft PnP Utility
Processing inf : Android_USB_Assistant.inf
Successfully installed the driver.
Driver package added successfully.
Published name : oem89.inf
Total attempted: 1
Number successfully imported: 1
Installing Android Emulator USB Passthrough Assistance Driver
SERVICE_NAME: UsbAssist
TYPE : 1 KERNEL_DRIVER
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
[SC] DeleteService SUCCESS
SERVICE_NAME: UsbAssist
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 0
FLAGS :
Find your connected USB Devices
Code:
emulator -list-usb
VID:PID 058f:6387 (Bus 1, Port 5.1.1)
Manufacturer:
Product:
SerialNumber: 40A0FE0A
VID:PID 067b:2303 (Bus 1, Port 5.1.2)
Manufacturer: NA
Product: NA
SerialNumber: NA
VID:PID 0403:6001 (Bus 1, Port 5.1.2)
Manufacturer: FTDI
Product: USB-to-Serial
SerialNumber: FT9QIQ6Y
VID:PID 1bcf:284c (Bus 1, Port 5.1.2)
Manufacturer: SunplusIT Inc
Product: 5MP USB webcam
SerialNumber: N2020040701
Now you can use those VID : PID combination to pass it through your AVD
Code:
emulator -netdelay none -netspeed full -avd Pixel_4_API_3 -usb-passthrough vendorid=0x058f,productid=0x6387
Multible VID : PID combinations are also possible
Code:
emulator -netdelay none -netspeed full -avd Pixel_4_API_32 -usb-passthrough vendorid=0x058f,productid=0x6387 -usb-passthrough vendorid=0x067b,productid=0x2303
Unfortunately the emulator will show this Error:
Code:
qemu-system-x86_64.exe: libusb_kernel_driver_active: -12 [NOT_SUPPORTED]
But the Devices are still passed through.
They will not be shown in the AVD nor recognized as a Device in any way.
In order to accomplish this, you must:
root the AVD with Magisk (Canary for 64-Bit only AVDs)
patch the FSTAB to get USB Drives automaticly mounted as a drive
install my USB Host Permissions Magisk Module
This can be done by:
Code:
rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-32\google_apis_playstore\x86_64\ramdisk.img PATCHFSTAB GetUSBHPmodZ
The Magisk Module will be put into the local Download folder of the AVD.
AVDs with a Kernel Version lower then 5.4.65 need either a custom build kernel with the
USB features enabled or an updated prebuild Kernel directly from the AOSP.
Code:
rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules PATCHFSTAB GetUSBHPmodZ
[Update 10.10.2022]
Spoiler: For MacOS Only.
Recently I've stumbled across this Question on stackoverflow:
How to use USB with QEMU on a Mac host?
In there is a discussion mentioned, on GitHub, that kind of resolved the issue
with USB Passthrough Feature and LibUSB.
macOS: implement kernel driver detach #911
followed by a very good explanation on what is actually going on with the real reasons behind it.
How to use the new macOS kernel detach feature for non-root user no solution as of now for libuvc users #1014
However, long story short, the USB Passthrough Feature for AVDs works now If you boot the AVD with
root privileges. Here is what I did to get it working.
Install libusb 1.0.26 via Homebrew:
brew install libusb
or check your libusb version first:
Code:
brew list --versions libusb
libusb 1.0.26
I am on MacOs Monterey now:
Code:
[email protected] % sw_vers
ProductName: macOS
ProductVersion: 12.6.1
BuildVersion: 21G217
[email protected] % emulator
INFO | Android emulator version 31.3.13.0 (build_id 9189900) (CL:N/A)
The following examples and devices I've tested so far:
USB Drive 2GB:
Code:
export PID="0x6387"
export VID="0x058f"
sudo emulator \
-netdelay none \
-netspeed full \
-no-snapstorage \
-avd Pixel_4_API_33 \
-qemu -usb \
-device usb-ehci,id=ehci \
-device usb-host,bus=ehci.0,vendorid="$VID",productid="$PID"
Code:
2022-11-10 16:32:14.088 qemu-system-x86_64[9002:323007] vendorID: 0x058f (1423), productID: 0x6387 (25479)
2022-11-10 16:32:14.088 qemu-system-x86_64[9002:323007] Command line USB devices: ("vendorID: 0x58f, productID: 0x6387")
2022-11-10 16:32:14.088 qemu-system-x86_64[9002:323007] Acquiring USB Exclusive access for device: <vendorID: 0x58f, productID: 0x6387>
2022-11-10 16:32:14.092 qemu-system-x86_64[9002:323007] Service authorization failed with error with return code: -536870202
What doesn't work is unplugging and re-plugging. The AVD needs to boot with it. Every time the AVD boots, the Disk Not Ejected Properly Message pops up. Even if it says Service authorization failed with error with return code: -536870202, the device pops up system wide.
USB 3.0 Hard Drive:
Code:
export PID="0x5106"
export VID="0x174c"
sudo emulator \
-netdelay none \
-netspeed full \
-no-snapstorage \
-avd Pixel_4_API_33 \
-qemu -usb \
-device qemu-xhci,id=xhci \
-device usb-host,bus=xhci.0,vendorid="$VID",productid="$PID"
I guess the AVD doesn't like the filesystem on that drive.
USB WebCam (uvc):
Code:
export PID="0x636d"
export VID="0x0c45"
sudo emulator \
-netdelay none \
-netspeed full \
-no-snapstorage \
-avd Pixel_4_API_33 \
-qemu -usb \
-device qemu-xhci,id=xhci \
-device usb-host,bus=xhci.0,vendorid="$VID",productid="$PID"
USB-to-Serial Device:
Code:
export PID="0x6001"
export VID="0x0403"
sudo emulator \
-netdelay none \
-netspeed full \
-no-snapstorage \
-avd Pixel_4_API_33 \
-qemu -usb \
-device qemu-xhci,id=xhci \
-device usb-host,bus=xhci.0,vendorid="$VID",productid="$PID"
Conclusion:
The AVDs/Qemu USB Passthrough Feature paired with libusb on MacOs is still a farce.
Makes me wonder how Parallels Desktop is capable since kajillian years of passing any kind
of USB device through, without any root. And they have literally patch there Tools every Kernel
version.
Thanks for reading
Cheers NewBit
Thanks and Credits to @topjohnwu , Alabate, Google, Qemu and Jitendra
QEMU/Devices/USB/Root
USB Quick Start
USB recommendations for qemu
qemu usb storage emulation
Have you mange to make it work on windows ?
Have you mange to make it work on windows ?
tomek_be said:
Have you mange to make it work on windows ?
Click to expand...
Click to collapse
Sorry for the late response, I didn't get any notice...
No I did not even try it. Did you?
I did but with no luck. Emulator correctly creates USB controller and /sys/kernel/debug/usb/devices contains entries corresponding with command line options but passthrough USB device is not discovered by the kernel. Sometimes emulator produces message on stdout that devices has been attached or detached but it is not repeatable. I tried different hardware accelerations ( HAXM and WHPX ) - nothing . BTW - on linux it worked like a charm - only thing I need to do was creating proper /system/etc/permissions/android.hardware.usb.host.xml. After that non modified kernel picked up usb device.
tomek_be said:
I did but with no luck. Emulator correctly creates USB controller and /sys/kernel/debug/usb/devices contains entries corresponding with command line options but passthrough USB device is not discovered by the kernel. Sometimes emulator produces message on stdout that devices has been attached or detached but it is not repeatable. I tried different hardware accelerations ( HAXM and WHPX ) - nothing . BTW - on linux it worked like a charm - only thing I need to do was creating proper /system/etc/permissions/android.hardware.usb.host.xml. After that non modified kernel picked up usb device.
Click to expand...
Click to collapse
Weird, I still don't get any notice.
So you did try it on Linux with Stock Kernel and permission xml file!? -> it worked
You also tried the same thing on Windows? -> it didn't worked
Is it the same/similar AVD version? Is the syntax on windows different? What commands did you use exactly?
Is your AVD rooted? Did you cross compare the Kernel Configs? Kernel Versions?
What USB Device exactly you are trying to pass through?
Hello fellows, Did you find the way to make it work in Windows ?, It's hard to create apps that need interaction with USB / Bluetooth devices under Windows environment !, I wonder why these guys at Google make it so hard ?
mariodantas said:
Hello fellows, Did you find the way to make it work in Windows ?, It's hard to create apps that need interaction with USB / Bluetooth devices under Windows environment !, I wonder why these guys at Google make it so hard ?
Click to expand...
Click to collapse
It was actually already solved, the same way like on linux. But Google
decided to take out the USB Pass Through Feature on Windows.
Android emulator USB passthrough fails: " 'usb-host' is not a valid device model name"
So the only chance would be to get back to Version 30.5.2 (build_id 7175973) (Feb 27, 2021) to try it out.
Hard to develop apks that need to cope with USB or BT in Windows machines, what's wrong with Google ?
Thanks for your information buddy !
mariodantas said:
what's wrong with Google ?
Click to expand...
Click to collapse
I've stopped wondering since they put this sneaky covid "feature" undetected on my phone.
mariodantas said:
Hard to develop apks that need to cope with USB or BT in Windows machines
Click to expand...
Click to collapse
Yes, totally. But Microsoft is to blame as well, according to Erwin Jansen.
I guess you need to remotely debug your apk directly on your phone/device.
mariodantas said:
Thanks for your information buddy !
Click to expand...
Click to collapse
No problem, If there is any USB update in the Windows Version, I am happily updating this Guide.
Hello newbit,
USB passthrough with (ASUS USB-BT400 USB Adapter USBBT400) on Linux is working fine, Emulator is able to connect to phone with BT dongle mentioned above - followed steps in android link - https://source.android.com/devices/automotive/start/passthrough
But when trying the same in MAC OS, I could see BT dongle is getting detected in Emulator as shown below (0b05:17cb) but BT in emulator not working. So, not able to connect to phone.
1|emulator:/ # lsusb
Bus 004 Device 001: ID 1d6b:0002
Bus 004 Device 002: ID 0b05:17cb
Bus 002 Device 001: ID 1d6b:0002
My question is that, In linux I have Update udev settings to allow the user process (e.g. QEMU) to have read/write permissions:
$ echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="17cb", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-mynew.rules >/dev/null
$ sudo udevadm control --reload
$ sudo udevadm trigger
But in MAC OS I am not sure how to do the same ie Update udev settings to allow user process to have read/write permissions ? I am not sure if this is the problem ? Are you successful with USB passthrough on MAC OS ?
I am currently blocked and any inputs on this regard would be great. Thanks
nrajeevlochan said:
Hello newbit,
USB passthrough with (ASUS USB-BT400 USB Adapter USBBT400) on Linux is working fine, Emulator is able to connect to phone with BT dongle mentioned above - followed steps in android link - https://source.android.com/devices/automotive/start/passthrough
But when trying the same in MAC OS, I could see BT dongle is getting detected in Emulator as shown below (0b05:17cb) but BT in emulator not working. So, not able to connect to phone.
1|emulator:/ # lsusb
Bus 004 Device 001: ID 1d6b:0002
Bus 004 Device 002: ID 0b05:17cb
Bus 002 Device 001: ID 1d6b:0002
My question is that, In linux I have Update udev settings to allow the user process (e.g. QEMU) to have read/write permissions:
$ echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="17cb", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-mynew.rules >/dev/null
$ sudo udevadm control --reload
$ sudo udevadm trigger
But in MAC OS I am not sure how to do the same ie Update udev settings to allow user process to have read/write permissions ? I am not sure if this is the problem ? Are you successful with USB passthrough on MAC OS ?
I am currently blocked and any inputs on this regard would be great. Thanks
Click to expand...
Click to collapse
Hi @nrajeevlochan,
as mentioned above, Mac doesn't have this UDEV feature like Linux has it. Depending on the Mac OS Version,
I had to extract and copy some dylib files from a newer Mac OS Version to my running Version. The Error
output was gone, but the USB Device wasn't passed through. So for now, I cannot provide something useful to get the USB Pass through feature running on Mac OS. The only, non-convenient work around is, to adb remote connect to your Linux AVD. But you need either 2 separate Machines or a virtual Machine running in your Mac. Which will cost you a lot of performance. Is there any error message on the terminal regarding your USB?
newbit said:
Hi @nrajeevlochan,
as mentioned above, Mac doesn't have this UDEV feature like Linux has it. Depending on the Mac OS Version,
I had to extract and copy some dylib files from a newer Mac OS Version to my running Version. The Error
output was gone, but the USB Device wasn't passed through. So for now, I cannot provide something useful to get the USB Pass through feature running on Mac OS. The only, non-convenient work around is, to adb remote connect to your Linux AVD. But you need either 2 separate Machines or a virtual Machine running in your Mac. Which will cost you a lot of performance. Is there any error message on the terminal regarding your USB?
Click to expand...
Click to collapse
Hi newbit,
Thanks for your quick response.
Please see the error I am getting with "dmesg | grep usb" below:
emulator:/ # dmesg | grep usb
[ 205.231407] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[ 205.383241] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 64
[ 205.384500] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x2 has invalid maxpacket 64
[ 205.385742] usb 1-1: config 1 interface 2 altsetting 0 bulk endpoint 0x84 has invalid maxpacket 32
[ 205.387163] usb 1-1: config 1 interface 2 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 32
[ 205.392405] usb 1-1: New USB device found, idVendor=0b05, idProduct=17cb, bcdDevice= 1.12
[ 205.393828] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 205.395216] usb 1-1: Product: BCM20702A0
[ 205.395983] usb 1-1: Manufacturer: Broadcom Corp
[ 205.396874] usb 1-1: SerialNumber: 5CF370A4407D
[ 205.405316] usb 1-1: can't set config #1, error -32
[ 205.566482] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd UsbDeviceHandle rqt 192 rq 51 len 2 ret -110
[ 205.621767] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd UsbDeviceHandle rqt 192 rq 51 len 2 ret -110
nrajeevlochan said:
Hi newbit,
Thanks for your quick response.
Please see the error I am getting with "dmesg | grep usb" below:
emulator:/ # dmesg | grep usb
[ 205.231407] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[ 205.383241] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 64
[ 205.384500] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x2 has invalid maxpacket 64
[ 205.385742] usb 1-1: config 1 interface 2 altsetting 0 bulk endpoint 0x84 has invalid maxpacket 32
[ 205.387163] usb 1-1: config 1 interface 2 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 32
[ 205.392405] usb 1-1: New USB device found, idVendor=0b05, idProduct=17cb, bcdDevice= 1.12
[ 205.393828] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 205.395216] usb 1-1: Product: BCM20702A0
[ 205.395983] usb 1-1: Manufacturer: Broadcom Corp
[ 205.396874] usb 1-1: SerialNumber: 5CF370A4407D
[ 205.405316] usb 1-1: can't set config #1, error -32
[ 205.566482] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd UsbDeviceHandle rqt 192 rq 51 len 2 ret -110
[ 205.621767] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd UsbDeviceHandle rqt 192 rq 51 len 2 ret -110
Click to expand...
Click to collapse
My apologies @nrajeevlochan,
I didn't even notice that you've replied to my question.
[ 205.405316] usb 1-1: can't set config #1, error -32
indicates, that the AVD actually detects the device, and can even read some low level information from it.
Like Product, VID, PID etc. But the host system doesn't fully let it go, so this error can't set config #1, error -32 shows up, indicating that state.
I do have some positive updates tho, you might wanna check out the
[Update 10.10.2022]
For MacOS Only.
Cheers NewBit

Categories

Resources