sh 一个简单的Bash脚本,用于在Nexus设备上缓存和测试Ubuntu Touch频道。请参阅https://developer.ubuntu.com/en/start/ubuntu-for-de

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 一个简单的Bash脚本,用于在Nexus设备上缓存和测试Ubuntu Touch频道。请参阅https://developer.ubuntu.com/en/start/ubuntu-for-de相关的知识,希望对你有一定的参考价值。

#!/bin/bash
#
# ubuntu-touch-tester.sh
#
# A simple script to cache and install available 
# Ubuntu Touch images on select Nexus devices.
#
# For more info see:
#   https://developer.ubuntu.com/en/start/ubuntu-for-devices/devices/
#
# For dependencies see:
#   https://developer.ubuntu.com/en/start/ubuntu-for-devices/installing-ubuntu-for-devices/
#
# modified: Sun Nov 29 07:39:49 CST 2015
# author: mark page [m.e.page_at_gmail.com]
#
declare -a devices=( mako flo manta );
declare -a channels=( devel-proposed devel rc-proposed rc stable ); 

clear
echo "========================================"
echo " Ubuntu Touch Tester"
echo "========================================"
echo 
echo "Available Devices"
echo 
echo " [1] Nexus 4 (mako)"
echo " [2] Nexus 7 2013 (flo)"
echo " [3] Nexus 10 (manta)"
echo 
echo -n "Select Device: "
read device

if ! [[ ${device} =~ ^[1-3]$ ]]; then
  echo
  echo "Invalid option, exiting..."
  echo
  exit 1
fi

for i in ${channels[@]}; do
  clear
  echo "Channel: \"$i\" for device \"${devices[$device-1]}\" (update cache only)..."
  echo
  sudo ubuntu-device-flash --download-only touch --device=${devices[$device-1]} --channel=ubuntu-touch/$i/ubuntu --bootstrap
  sleep 5
done

clear
echo 
echo "Available Channels (${devices[$device-1]})"
echo 
echo " [1] devel-proposed"
echo " [2] devel"
echo " [3] rc-proposed"
echo " [4] rc"
echo " [5] stable"
echo 
echo -n "Select Channel: "
read channel

if ! [[ ${channel} =~ ^[1-5]$ ]]; then
  echo
  echo "Invalid option, exiting..."
  echo
  exit 1
fi  

clear
echo "==================================================="
echo " WARNING: This will *completely* wipe your device! "
echo " Are you absolutely sure you want to do this?          "
echo "==================================================="
echo -n "Type \"yes\" and hit [ENTER] to continue: "
read confirm
if [ -z "${confirm}" ] || [ "${confirm}" != 'yes' ]; then
  echo
  echo "User cancelled, exiting..."
  echo
  exit 1
fi  

clear
echo "Formatting \"system\""
sudo fastboot format system

clear
echo "Formatting \"userdata\""
sudo fastboot format userdata

clear
echo "Formatting \"cache\""
sudo fastboot format cache

clear
echo "Flashing device..."
sudo ubuntu-device-flash -v touch --channel=ubuntu-touch/${channels[$channel-1]}/ubuntu --bootstrap

exit 1

以上是关于sh 一个简单的Bash脚本,用于在Nexus设备上缓存和测试Ubuntu Touch频道。请参阅https://developer.ubuntu.com/en/start/ubuntu-for-de的主要内容,如果未能解决你的问题,请参考以下文章

sh 一个简单的bash脚本,通过ADB在Marshmallow +设备上启用演示模式(基于http://bit.ly/295BHLx)

sh 一个简单的bash脚本,通过ADB在Marshmallow +设备上启用演示模式(基于http://bit.ly/295BHLx)

sh 一个简单的bash脚本,通过ADB在Marshmallow +设备上启用演示模式(基于http://bit.ly/295BHLx)

sh 一个简单的bash脚本,通过ADB在Marshmallow +设备上启用演示模式(基于http://bit.ly/295BHLx)

sh 一个简单的bash脚本,通过ADB在Marshmallow +设备上启用演示模式(基于http://bit.ly/295BHLx)

sh 一个简单的bash脚本,通过ADB在Marshmallow +设备上启用演示模式(基于http://bit.ly/295BHLx)