Android source code is compiled locally and mapped to a local disk to view the code

Compiling the code locally is very simple, as long as the source code of the remote warehouse is synchronized to the server, then the local compilation can be executed through the command. After compiling the source code locally, you can upload your own project files and compile the apk.

1. Local compilation of Android source code

1. You need to use sudo permission for ordinary users 
# usermod -a -G sudo name (account name for downloading source code yourself, account with sudo permission does not need this step)
2. Install and compile the environment 
$ sudo apt-get install git-core gnupg flex bison build-essential zip curl zlibg-dev gcc-multilib g++-multilib libc6-dev-i
3. Start compiling local source code 
$ source build/envsetup.sh 
$ lunch userdebug (debug in the source code directory, you need to find it yourself, each project different) 
$ make -j32 

After executing make, wait for half an hour, and the source code is compiled ok

2. Android source code mapped to local disk

1. Install samba-service 
sudo apt-get install samba samba-common 

2. Modify the configuration file sudo vi /etc/samba/smb.conf 
security = user 
[public] 
path = /data/name #Fill in your own shared folder path
browseable = yes 
writeable =yes 
public = yes 
guest ok = yes 
3. Give shared folder permissions 
sudo chmod 777 /data/name 
4. Set password 
sudo smbpasswd -a name
5. View all samba accounts 
sudo pdbedit -L 
6. Restart service
sudo service smbd restart
7. Check ubuntu to get ip
ifconfig
8. Set ip Copy the address to the local network mapping path and find
\\192.43.55.21\public

In this way, the source code can be mapped to the local disk, and you can look at the source code happily! They are all tested by themselves, and the code cannot be posted.

If it is not intuitive to paste the command directly, you can leave a comment.

Guess you like

Origin blog.csdn.net/qq_37870139/article/details/131485368