Installing AOSP on nexus 7 (Wifi) - android

I am stuck flashing android to my nexus 7.
Steps to build image:
branch: refs/tags/android-4.4.2_r1
lunch : aosp_flo-userdebug
What i´ve done so far after building the image:
Like descibed in docs:
http://source.android.com/source/building-running.html
sudo fastboot flashall -w -p /home/stefan/bin/out/target/product/flo/
Gives me the following error:
could not load android-info.txt: No such file or directory.
So no luck with that, tried searching google but didnt find anything.
Downloaded an official rom 4.4.2 (KOT49H) from the nexus driver page:
https://developers.google.com/android/nexus/drivers
Deleted everything in the update package (zip) and putted my files in.
Then did sudo sh flash-all.sh
This method do flash the rom onto the device, but it also wont boot.
It hangs on the google splash screen.....
Is there anybody who can tell me how to properly flash my AOSP rom to device?

Your number 2 definitely will not work, and you shouldn't bother going down that route.
So the first issue you might have is you may be trying to build the wrong image, there are two Nexus 7s. Grouper is the designation for the first generation Nexus 7 and Flo is the designation of the 2013 Nexus 7, so make sure you have those right.
The second issue you may be having is the build may be failing. Are you sure that your make completed successfully? Your final message should say something similiar to
Install system fs image: out/target/blah/blah/blah/system.img
If you didn't see a line like that your build failed in which case you should diagnose that.
The third issue is you may be pointing at the wrong file. The line you are giving expects a full package, and you may not have created one. Try doing this instead:
sudo su
. build/envsetup.sh
lunch aosp_flo-userdebug
fastboot flashall -w
This will look for the generated files from the build automatically without you having to point at them, so long as you have selected the proper lunch option. Another issue you may be having is you may be confusing your shell with sudo, I am guessing you haven't bothered setting up the proper USB Permissions (see configuring USB access on the AOSP Build Guide. If you don't want to bother setting up USB permissions, then just initialize your environment as the super user after you have built when you need to flash (not before, or all your files will belong to root!)

Related

Getting "error: device offline" from adb.exe in Android Player SDK / Setting Up Unity Remote 5 (Solved)

First of all, this is my first post here and I'm a beginner so my apologies if this ends up being a stupid question or my format is wrong, but any help is appreciated.
Essentially my problem is in trying to set up Unity Remote 5 for debugging in Unity. However, I believe I've finally narrowed it down. The error I'm getting now seems clear:
CommandInvokationFailure: Unity Remote requirements check failed
C:/Program Files/Unity/Hub/Editors/2019.4.17f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\platform-tools\adb.exe forward tcp:7201 tcp:7201
stderr[ error: device offline]
stdout[]
exit code: 1
I've looked into this error and came upon this: https://stackoverflow.com/a/39031464/14948855 which seems like it might be useful to me, however the issue is I don't know how to run the commands he suggested and stack overflow made it clear it didn't want me posting a question as a response to that question and I don't have enough prestige to comment.
I'm trying to run "sudo adb kill-server" from an ubuntu linux terminal on windows from the directory abd is in (C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools), but it won't run.
proof command not found
I've tried adding it to the path on my computer: I added the directory listed above to "Path" in my "Environment Variables".
My phone is plugged in, I've disabled and reenabled developer mode and usb debugging, and restarted Unity and my phone several times. Any help with running this command in ubuntu or cmd, or even the greater problem of Unity Remote 5 would be fabulous.
Thank you.
Edit: here's a better image showing my issue:
image showing how I've tried to add the folder to the path but it still can't be reached
Final Update:
All my problems have been solved, here's how I got unity remote 5 for android working for posterity:
step 1) Make sure phone is in developper mode (go to "about phone" in settings, tap build number 7 times).
step 2) Make sure "USB debugging" is turned on in developer options.
step 3) Make sure Unity is updated to the most recent supported version through Unity Hub (might not be required but I did this step).
step 3) Download android support module through Unity Hub.
note: if you downloaded current Unity version from the Unity website rather than through Unity Hub, it doesn't seem to let you add modules to it through Unity Hub.
step 4) The sdk path Unity specifies by default is wrong for some reason, so in preferences->external tools, disable the default path and paste in the right directory (should be something like: C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK) to be safe I did this for the JDK, NDK and Gradle too.
step 5) When you plug in phone, pull down your notifications, hit "tap to change USB options" and make sure phone is in "camera" mode or some variation. For me it was "Photo transfer".
Note: if you don't have the option to change USB options, try different usb ports/cables, if those don't work you might have debris in your charging port, clean it out with a dab of 91% or 99% rubbing alcohol and a tooth brush/tweezers (this will also make charger sit more snug in phone)
That might be enough to get it working for you, if not...
step 6) (Not sure if necessary) May need to update phone drivers in device manager on windows.
step 7) If Unity gives an adb error saying too many devices connected, it's possible you have a daemon running in the background which adb is picking up as an android emulator because it's using a port greater than 5555. It seems adb checks open ports above port 5555, and assumes anything it finds is an emulator. To check this, as indicated in my original question, and as stated here: https://stackoverflow.com/a/39031464/14948855, in cmd on windows use adb devices (if ur on linux may need to use sudo) to get a list of all devices being detected by adb. (Also use "adb kill-server" to reset it.) If there is an emulator being detected, it should include the port it's using in its name, in my case it was "emulator-5562" in port 5562, which was apparently actually NTKDaemon from Native Instuments, a random music production program I've only used once so far. I'd suggest googling the emulator port you find to try and narrow down the process taking that port. The only thing left to do is to kill the process running in the port. I found NTKDaemon in task manager and also disabled it activating on startup because that's just evil imo.
And that should be it. Hope that works for you if you're here for help.
(btw in terms of my original question, I was able to access adb.exe by changing the directory in cmd, but I still never found why adding the directory to the path didn't work, so if anyone has an answer to that I would be interested)

Nativescript emulator installation headaches

I've been trying to get emulators to work for NativeScript on my brand new clean Windows 10 laptop for three days and nothing is working.
To be more accurate, I think I was able to get the 'emulator-5554' to launch, but it doesn't not load the Groceries app.
I have all the Angular requirements installed since I also build Angular SPAs and they work fine. I read and followed all these articles, and I still can't get emulators to work.
I even installed GenyMotion, but it is not detected. I have not installed Android Studio since I'll be developing with Visual Studio Code, so I used the Android CLI to install the SDK.
https://docs.nativescript.org/start/general-requirements
https://docs.nativescript.org/start/introduction
https://docs.nativescript.org/start/cli-basics
https://docs.nativescript.org/tooling/android-virtual-devices?_ga=2.188319272.1221867054.1547512018-618552819.1547075699
https://docs.nativescript.org/start/quick-setup
https://docs.nativescript.org/start/ns-setup-win - this was my primary emulator setup
I have also read many SO posts and none have solved my problem.
Is there some documentation somewhere that is simple and clear, with step by step instructions on how to get emulators installed that will work with Nativescript? What am I missing?
BTW, when I connect my Samsung Galaxy S8 Active phone to my laptop, it's not recognized by the tns device command either.
I can't believe it's this difficult to get emulators to work. I also can't believe that the Nativescript documentation has left this information out of their instructions.
This might not be the answer most are looking for, but this is what was wrong with my installation and this is how I fixed it:
I noticed that the docs all had $./advmanager [someArg] and I had to be sudo for commands to execute. So I ran sudo chown -R myUser:myUser /usr/local/android thus changing all owner:group permissions from root to myUser.
then I could run ./avdmanager create.... (full command below) without having to be superuser
restarted Nativescript Sidekick
I know this is kinda stupid, but I worked out that if the AVD was created as root, the Sidekick program running as myUser could not see and access it. This was confirmed when I ran avdmanager list avd as sudo and got a result, but after changing my files' ownership from root to myUser, nothing was listed from the same command.
I recreated my virtual devices (AVDs) as a normal user and Sidekick was able to see them.
edit: the actual line I ran to create the AVD (because I see a lot of variation in these):
$ ./avdmanager create avd --name Pixel -k "system-images;android-28;google_apis;x86" --device "pixel"?
The uppercase and lowercase "pixel"s come from one entry from the output of
$./avdmanager list
id: 17 or "pixel"
Name: Pixel
OEM : Google
---------
Do this "create" step for each device you want to emulate.
Install Android Studio and open it. Then (without starting a new project) click on:
Configure --> AVD Manager.
There you can create virtual devices, which will be recodnized by NativeScript Sidekick and its virtual device launcher.

Run custom ROM on Android Emulator

I downloaded a third-party ROM, and I want to run it on the emulator first before flash it into the phone. Here is the contents of cm-11-20140911-NIGHTLY-p3110.zip:
1. boot.img
2. file_contexts
3. META-INF/
4. recovery/
5. system/
I unpacked boot.img using the script unpack-bootimg.pl and get boot.img-kernel, and boot.img-ramdisk.cpio.gz. Then I repacked the system using the make_ext4fs and got system.img.
I created an AVD and execute:
emulator -system ~/cm11/system_new.img -ramdisk ~/cm11/boot.img-ramdisk.cpio.gz -kernel ~/cm11/boot.img-kernel -avd and442
but all I got is nothing, the emulator screen is just black. There is no log message from adb -s emulator-5554.
Now I am confused:
can the third-party ROM be tested by the emulator?
Am I doing the right way?
Yeah, why not.
We can flash a third-party ROM on Android AVD. But first you must know the following things:
1. The Android Emulator is itself a device, like your Moto G or Xperia
2. Every ROM is device-specific (supports a device-specific Kernel)
(on many sites/blogs you got information like you have to replace system.img file from .android\avd\avdname.avd, but it is technically incorrect, because you also require ramdisk.img.)
To do this, you need to create your own AOSP repository by downloading the particular repository and have to build your own .img files)
You can do it in two ways:
replace files system.img and ramdisk.img from location .android\avd\avdname.avd
Build your own AOSP. Before... make in "lunch" select target as: Emulator (like: genericX86), i.e., generate all emulator specific .img files
I have tried many things. It's a bit critical, but interesting. The following links may help you:
To run your cooked ROM on Emulator (link down. Try this, from archive.org).
To Create AOSP Project

Unable to debug via eclipse on phone with Jelly Bean

I have a nexus S for sprint that I am using as a developer phone rooted to be running android 4.1. Eclipse recognizes the phone, drivers, etc. I can run "adb devices" and the phone id is displayed. However, if I try to debug my app or any other imported project I get the following error:
Unable to open zip '/data/local/tmp/com.myapp.apk': Permission denied
(I would post the image but haven't posted here before)
If I manually transfer the .apk and install via Astro, everything runs perfectly. I am considerably lost and any help would be appreciated.
For anyone looking at this with a more recent version of the siyah kernal, if you don't wish to switch your kernel, you can use the "ExTweaks" app to change a settings under "MISC" called "ADB Binary Mode". I set this to "Development ADB"(was "Normal ADB") and can now successfully debug with eclipse! :D
I have a custom ROM installed in my Galaxy S2. Searching by google i came to this post: http://forum.xda-developers.com/showpost.php?p=29454043&postcount=203
The problem in my case was the kernel too (Siyah 3.5.2).
I installed another kernel for JB (http://developer.clockworkmod.com/downloads/51/3354/kernel-cm-10-20120801-i9100-signed.zip) and the problem was solved.
Basically
/data/local
doesn't have the right permissions, so a simple:
adb shell
cd /data
chmod 777 local
should work. (Not sure if the new permissions are overbroad, but I'm not too worried)
As per ekim's answer, I had the same issue, again, a Galaxy S2, etc. The latest version of Siyah fixes this problem and I can get back to running/debugging from Eclipse.
I updated SGS3 (I9300) to stock 4.1.1 ROM and I got the same problem.
After I unsuccessfully tried everything here and elsewhere suggested:
clean all projects
install via adb chmod 777 for /data/local/tmp (and direct subfolders)
dancing the chicken dance (dunno who suggested that, but at least it
produced some laughs ;)
etc.
I installed SiyahKernel S3-v1.6.8 and the problem was gone.
After inspecting my UMASK, I saw it's now 0000 (and it was 0077 on stock kernel), so I concluded that the wrong UMASK was the root cause of the error.
Still, as can be seen from numerous other threads on this issue out there, it's very wrong for the stock kernel to cause that problem.
Here's a quick way to see if it's a permission issue:
adb install -s Your.apk
this will install on the SDcard rather than /data/local

error: could not load android-info.txt

After I built the source code of android, I ran the following command and got the error.
#fastboot -w flashall
error: could not load android-info.txt
I had successfully built the source code for nexus one (build 5), and I found that there is a android-info.txt file in the directory out/target/passion/.
Also, I am sure that the phone is connected. When I run "fastboot devices", it shows the device.
Anybody know the reason?
Old thread so sorry for reactivating it, but it's still one of the top hits and it's unanswered.
My fix was to ensure I had the ANDROID_PRODUCT_OUT environment variable, and that it was pointing to
/home/{usr name}/{build directory}/out/target/product/{taget}
Again, sorry for resurrecting a dead post.
As $fastboot flashall -w
flash the Rom on connected device it needs to know which Run/Device/Product you want to flash as there might be many products available in out/target/product directory,
And so product is obtained by ANDROID_PRODUCT_OUT variable which should point to any product i.e.
/home/{usr name}/{build directory}/out/target/product/{taget}
And to set the ANDROID_PRODUCT_OUT we just need to do:
source build/envsetup.sh
lunch
and choose your product in lunch menu, so that fastboot flashall -w would know which product you wanna flash.
It depends on how the flash all script is organized. Try flashing into the partition directly.
Eg: fastboot flash system system.img
I observed this issue when trying to fastboot update an OTA package.
Eg: fastboot update xyz.zip.
Currect way to update via fastboot is
fastboot update updateImagename.img
Call lunch to set the environment variables needed.
For example,
'lunch aosp_flo-eng' can be called to make sure the environment is in order for the Nexus 7 [2013] tablet.

Categories

Resources